in reply to Arrays: Last-index special variable vs. scalar values

Why should that 2 be a 5? Saying $#ary2 will give you the index of the last array element, in this case 2. I've never seen anywhere that says $# should return the value of the last element. This makes perfect sense with the use of scalar(@ary2) as well. Witness:
scalar(@ary2) == $#ary2 - $[ +1 scalar(@ary2) == 2 - 0 +1 scalar(@ary2) == 3 3 == 3

Makes sense to me.

Guildenstern
Negaterd character class uber alles!