Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: what is keys %$hash_ref [-1]

by philipbailey (Chaplain)
on Apr 27, 2011 at 19:17 UTC ( #901635=note: print w/replies, xml ) Need Help??


in reply to what is keys %$hash_ref [-1]

The fragment you have shown will not compile. The following will compile:

(keys %$hash_ref)[-1]

... and will return the "last" key of hash %$hash_ref. But that would seem somewhat meaningless, as the keys of a hash do not have any specific order. Any apparent order of the keys may change when the elements of the hash are changed, or a different Perl is used.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://901635]
help
Chatterbox?
[Discipulus]: nice Perl dreams, folks.. shower->Dumas->bed
[erix]: pere ou fils?
[Lady_Aleena]: Discipulus, good night.
[Discipulus]: pere, le vicomte de bragelonne.. wonderfull
[erix]: I'll keep that in mind (haven't read), buona notte :)
[Discipulus]: oh erix but is the fourth of cycle;read them in order
[erix]: hm, perhaps I can just read it here
Discipulus zzz...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2017-05-23 20:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?