Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Sorting Criteria

by Zaxo (Archbishop)
on Aug 05, 2003 at 18:24 UTC ( #281115=note: print w/replies, xml ) Need Help??


in reply to Sorting Criteria

The way to sort first by year, then month, then day,

sort { $hashYear{$a} <=> $hashYear{$b} or $hashMonth{$a} <=> $hashMonth{$b} or $hashDay{$a} <=> $hashDay{$a} } @unsorted;
though I haven't seen what the structure of your elements is. That might indicate another approach such as a Schwarzian Transfornm.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Sorting Criteria
by wizard341 (Acolyte) on Aug 05, 2003 at 18:31 UTC
    Thanks alot guys, works perfectly now.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2022-11-30 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?