Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Sorted tied hash wierdness

by Chmrr (Vicar)
on Nov 18, 2003 at 23:49 UTC ( #308189=note: print w/ replies, xml ) Need Help??


in reply to Sorted tied hash wierdness

You're getting too reference-happy. $_->[0] isn't the same as $_[0] -- the former treats $_ as an array ref, and takes the 0th element of that, while the second takes the 0th element of the @_ array. In this case, it's the latter you want. Change sub { $_->[0] <=> $_->[1] } to sub { $_[0] <=> $_[1] } and you'll have more luck.

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'


Comment on Re: Sorted tied hash wierdness
Select or Download Code
Replies are listed 'Best First'.
Re: Re: Sorted tied hash wierdness
by genecutl (Beadle) on Nov 19, 2003 at 00:01 UTC
    You're absolutely right. Don't you hate it when you waste time on something that should be completely obvious? Thanks!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (19)
As of 2015-07-31 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls