my $foo = [qw(a b c)]; if (defined $foo->[4]) { print "this will not print\n"; } print join('|', @$foo), "\n";