use strict; use warnings; my @array = (5, 10); my $index = undef; print $array[$index];