Welcome to the Monastery | |
PerlMonks |
Re: Sorted tied hash wierdnessby Chmrr (Vicar) |
on Nov 18, 2003 at 23:49 UTC ( [id://308189]=note: print w/replies, xml ) | Need Help?? |
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'
In Section
Seekers of Perl Wisdom
|
|