Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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.

Comment on Re: what is keys %$hash_ref [-1]
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://901635]
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-04-30 22:09 GMT
Find Nodes?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW

    Results (441 votes). Check out past polls.