in reply to What does $#variable mean?
And then of course there is push, pop, shift, unshift to make your life easier as well.my @array = qw(one two three); my $last_index = $#array; # Index of last element (2) my $last_element = $array[ -1 ]; # Value of last element (three)
Cheers - L~R
Update: Some other helpful things to remembermy $count = @array; # Number of elements (3) $#array = 99; # Extend/Truncate array
|
|---|