Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
@stuff = ( {"submitted","01/22/08"}, {"submitted","01/12/08"}, {"submitted","04/01/09"}, {"submitted","10/04/08"}, {"submitted","01/10/09"}, {"submitted","12/12/09"}, {"submitted","01/22/09"}, {"submitted","01/12/09"}, {"submitted","12/30/08"}, {"submitted","12/22/08"}, {"submitted","12/15/08"}, {"submitted","01/05/09"}, {"submitted","01/19/09"}, {"submitted","01/21/09"} ); @newstuff = sort bydte @stuff; foreach $pers (@newstuff) { print $$pers{submitted}."\n"; } sub bydte { $$a{submitted} <=> $$b{submitted}; #$$a{submitted} cmp $$b{submitted}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting by Date Help!
by moritz (Cardinal) on Mar 17, 2009 at 18:34 UTC | |
by Anonymous Monk on Mar 17, 2009 at 18:48 UTC | |
by moritz (Cardinal) on Mar 17, 2009 at 18:56 UTC | |
by Anonymous Monk on Mar 17, 2009 at 19:08 UTC | |
by moritz (Cardinal) on Mar 17, 2009 at 19:11 UTC | |
|
Re: Sorting by Date Help!
by almut (Canon) on Mar 17, 2009 at 19:54 UTC | |
by Anonymous Monk on Mar 17, 2009 at 20:35 UTC | |
by almut (Canon) on Mar 17, 2009 at 20:44 UTC | |
|
Re: Sorting by Date Help!
by poolpi (Hermit) on Mar 17, 2009 at 22:11 UTC | |
|
Re: Sorting by Date Help!
by VinsWorldcom (Prior) on Mar 17, 2009 at 19:55 UTC |