Problems? Is your data what you think it is? | |
PerlMonks |
Re^2: Get Element inArrayby Thilosophy (Curate) |
on May 25, 2005 at 02:53 UTC ( [id://460221]=note: print w/replies, xml ) | Need Help?? |
To explain that a little, negative array indices count from the end of the array: -1 is the last element, -2 the one before that, and so on.
Scalar value @arr[-2] better written as $arr[-2] And it should be $arr[-2] (with a $ sigil) at least in current Perl (Perl 6 will change that).
In Section
Seekers of Perl Wisdom
|
|