Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by philipbailey (Deacon)
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://901635]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2022-01-24 03:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (64 votes). Check out past polls.

    Notices?