Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: Sorting an Array

by choroba (Chancellor)
on Jul 31, 2014 at 17:22 UTC ( #1095779=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Sorting an Array
in thread Sorting an Array

Or, you can use Time::Piece (core since 5.10) and Orcish Maneuver:
my %cache; @sorted = sort { ( $cache{$a} //= 'Time::Piece'->strptime($a->{statement_date}, '%m +/%d/%Y') ) <=> ( $cache{$b} //= 'Time::Piece'->strptime($b->{statement_date}, '%m +/%d/%Y') ) } @statements;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Comment on Re^4: Sorting an Array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2016-05-02 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?