bionicle32 has asked for the wisdom of the Perl Monks concerning the following question:
The four fields are defined after the declaration of my for loop. I would greatly appreciate your help. All I need is to keep all of the rows as is, but sorted by the date the project was created.for (@links) { my ($status, $reference, $project, $created) = split(/\t/, $_); if ($status eq "Completed") { push(@complete, $_); } else { push(@progress, $_); } } my @sortedComplete = sort { $a->[3] <=> $b->[3] } @complete; my @sortedProgress = sort { $a->[3] <=> $b->[3] } @progress;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting a slurped file by a date field
by hardburn (Abbot) on Feb 03, 2004 at 23:03 UTC | |
|
Re: Sorting a slurped file by a date field
by ysth (Canon) on Feb 03, 2004 at 22:49 UTC | |
by bionicle32 (Novice) on Feb 04, 2004 at 00:00 UTC | |
by ysth (Canon) on Feb 04, 2004 at 01:42 UTC | |
by bionicle32 (Novice) on Feb 04, 2004 at 21:25 UTC |