my @array = qw/one two three four five/; print scalar @array; __OUTPUT__ 5 #### my @array = qw/one two three four five/; print $#array; __OUTPUT__ 4 #### my @array = qw/one two three four five/; $array[2] = undef; # undefine one of the elements. print scalar grep { defined $_ } @array; __OUTPUT__ 4 #### my @array = qw/one two three four five/; print $array[-1]; __OUTPUT__ five #### my @array = qw/one two three four five/; $#array = 99; print scalar @array; __OUTPUT__ 100