Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^5: perl sort issue while going through article at perl.com

by shmem (Chancellor)
on Oct 23, 2007 at 05:51 UTC ( [id://646641]=note: print w/replies, xml ) Need Help??


in reply to Re^4: perl sort issue while going through article at perl.com
in thread perl sort issue while going through article at perl.com

Number of keys is correct. Hash keys are unique. While you can say
my %hash = ( key => 'foo', key => 'bar', key => 'quux', key => 'fizz', key => 'buzz', );

in the sense that its's legal and perl won't complain, you end up with %hash containing just one entry. Each assignment overrides the previous one, and you have

%hash = ( key => 'buzz', );

finally.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-03-29 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found