Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: sorting with number then string

by pfaut (Priest)
on Feb 18, 2003 at 15:08 UTC ( [id://236266]=note: print w/replies, xml ) Need Help??


in reply to sorting with number then string

Use separate comparisons. That way you can control numeric vs. string comparisons.

@paths = sort { $MyInteger{$b} <=> $MyInteger{$a} || $MyString{$a} cmp $MyString{$b} } keys %MyKeys;
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-20 07:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found