Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^6: Sorting Template Toolkit Array of Hashrefs

by roho (Canon)
on Jul 23, 2012 at 15:33 UTC ( #983193=note: print w/replies, xml ) Need Help??


in reply to Re^5: Sorting Template Toolkit Array of Hashrefs
in thread Sorting Template Toolkit Array of Hashrefs

Thanks for your reply. And thanks to my "really, really smart" co-worker who not only suggested sorting in Perl, but also provided an example of how to do it:

my $sorted_results = [ sort { $a->{agendas}->[0]->{agendaDate} cmp $b- +>{agendas}->[0]->{agendaDate} } @$content ];

"Its not how hard you work, its how much you get done."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://983193]
help
Chatterbox?
[PriNet]: go figure, i just tried that, it retains some of the values (not the key) of the pre-assigned value
[PriNet]: i guess i'll just have to use two seperate hashes, there are two, but one is larger than the other, and when i reference the smaller one, it holds onto the values that were assigned to the larger hash (the keynames change, but unless i reassign a new valu

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2017-06-28 03:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (619 votes). Check out past polls.