Pavanvithal Torvi <[EMAIL PROTECTED]> asked: > While debugging a script I came across a scenario where array > access was happening with a negative index. > (because of a corner case that was not properly handled). > This resulted in accessing the array in a reverse order. [...] > I wanted to ask others if this is expected behaviour.
This is a Perl feature. See the perldata manpage (probably "perldoc perldata" on your system), section "Subscripts": "The array indices start with 0. A negative subscript retrieves its value from the end." HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/