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