c:\@Work\Perl\monks>perl -wMstrict -MData::Dumper -le "sub modify { $_ = 5 for @_; } ;; my @a; @a = (undef) x 5; ;; modify(@a); print Dumper \@a; ;; my @b; $#b = 4; ;; modify(@b); print Dumper \@b; ;; my @c; $#c = 4; $c[ $#c ] = undef; ;; modify(@c); print Dumper \@c; " $VAR1 = [ 5, 5, 5, 5, 5 ]; $VAR1 = [ undef, undef, undef, undef, undef ]; $VAR1 = [ undef, undef, undef, undef, 5 ]; #### c:\@Work\Perl\monks>perl -wMstrict -MData::Dumper -le "my @b; $#b = 4; ;; $_ = 5 for @b; print Dumper \@b; ;; my @c; $#c = 4; $c[ $#c ] = undef; ;; $_ = 6 for @c; print Dumper \@c; " $VAR1 = [ 5, 5, 5, 5, 5 ]; $VAR1 = [ 6, 6, 6, 6, 6 ];