Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
go ahead... be a heretic
 
PerlMonks  

Re: Sorting an AoHoH or AoHoAoH

by broquaint (Abbot)
on Jun 23, 2004 at 03:04 UTC ( #368929=note: print w/ replies, xml ) Need Help??


in reply to Sorting an AoHoH or AoHoAoH

A straightforward solution is to sort at a finer granularity e.g

use DDS; # your $events structure here ... @$events = sort { $a->{month} <=> $b->{month} } @$events; @{$_->{list}} = sort { $a->{date} <=> $b->{date} } @{$_->{list}} for @$events; Dump $events; __output__ $ARRAY1 = [ { list => [ { date => 10, name => 'picnic' }, { date => 15, name => 'high tea' }, { date => 23, name => 'rafting' } ], month => 7, name => 'July' }, { list => [ { date => 12, name => 'golfing' }, { date => 20, name => 'retreat' }, { date => 29, name => 'marathon' } ], month => 8, name => 'August' } ];
HTH

_________
broquaint


Comment on Re: Sorting an AoHoH or AoHoAoH
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2014-04-19 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (475 votes), past polls