in reply to $[ is under respected.
If $[ is set to 2, $foo[2] is the first element (foo). It seems that $foo[1] is the last element (quux), which is logical because 1 == $[ - 1. But while 0 == $[ - 2, $foo[0] isn't equal to penultimate element (baz), but it's equal to the first element (foo) - as if $[ doesn't effect an index equal to 0.my @foo = qw /foo bar baz quux/; $[ = 2; print $foo[2], "\n"; print $foo[1], "\n"; print $foo[0], "\n"; __END__ foo quux foo
|
|---|