Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Sorted tied hash wierdness

by Roger (Parson)
on Nov 19, 2003 at 00:03 UTC ( [id://308193]=note: print w/replies, xml ) Need Help??


in reply to Sorted tied hash wierdness

You can change the line:
$_->[0] <=> $_->[1]
to
$_[0] <=> $_[1]
or
@_->[0] <=> @_->[1]
and even insanely to
@{[shift]}->[0] <=> @{[shift]}->[0]
And it will work.

The last last solution is highly perl implementation dependent, it will not work if the order of evaluation changes in the future. I came up with it just to see if I could compare two shift's directly for fun. And yes it works. :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2025-01-15 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (49 votes). Check out past polls.