$aref = [qw/1 2 3/]; print $#$aref; print $#{$aref}; # it is not the same as scalar(@$aref) print scalar(@$aref);