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)