Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Get Element inArray

by Thilosophy (Curate)
on May 25, 2005 at 02:53 UTC ( #460221=note: print w/replies, xml ) Need Help??


in reply to Re: Get Element inArray
in thread Get Element inArray

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).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://460221]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-10-01 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (4 votes). Check out past polls.