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

Re^3: Sorting Template Toolkit Array of Hashrefs

by Anonymous Monk
on Mar 07, 2013 at 10:37 UTC ( [id://1022190]=note: print w/replies, xml ) Need Help??


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

This is how I explored before source diving in Sorting Template Toolkit Array of Hashrefs

[%# ## tpage sort.compound.tt ## tpage --debug=2047 sort.compound.tt ## tpage --debug=all sort.compound.tt ## ## tpage --debug=off sort.compound.tt ## tpage --debug=vars sort.compound.tt ## tpage --debug=filters sort.compound.tt ## tpage --debug=dirs sort.compound.tt ## tpage --debug=provider sort.compound.tt ## tpage --debug=plugins sort.compound.tt #~ unknown debug flag ## tpage --debug=flags sort.compound.tt ## tpage --debug=stash sort.compound.tt ## tpage --debug=undef sort.compound.tt ## tpage --debug=context sort.compound.tt ## tpage --debug=caller sort.compound.tt ## tpage --debug=parser sort.compound.tt ## tpage --debug=all sort.compound.tt ## tpage --debug=on sort.compound.tt ## tpage --debug=service sort.compound.tt ## ## http://perlmonks.org/?node_id=982470# Re^3: Sorting Template Toolki +t Array of Hashrefs ## ## ## ## COMMENTS END -%] [% SET results = [ { 'a' => [ { 'b' => 6 } ] }, { 'a' => [ { 'b' => 3 } ] }, { 'a' => [ { 'b' => 4 } ] }, { 'a' => [ { 'b' => 9 } ] }, ]; %] [% USE Dumper Indent = 0; GET Dumper.dump( results ); %] ## [% FOREACH item IN results.sort %] [% USE Dumper Indent = 0; GET Dumper.dump( item ); -%] [% END %] ## [% FOREACH item IN results.nsort('a.0.b') %] [% USE Dumper Indent = 0; GET Dumper.dump( item ); -%] [% END %] #################### #################### [% SET results = [ { 'a' => [ { 'b' => 6 } ], 'a.0.b' => 6 }, { 'a' => [ { 'b' => 3 } ], 'a.0.b' => 3 }, { 'a' => [ { 'b' => 4 } ], 'a.0.b' => 4 }, { 'a' => [ { 'b' => 9 } ], 'a.0.b' => 9 }, ]; USE Dumper Indent = 0; FOREACH item IN results.nsort('a.0.b'); GET Dumper.dump( item ); GET "\n"; END; %]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 08:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found