http://qs1969.pair.com?node_id=1893


in reply to How do I find the index of the last element in an array?

You can find it in the special variable $#arrayname

For example:
@foo=('b','a','r'); $lastindex=$#foo; #in this case 2 the index of 'r'