From b2b20a22373f96699484d7615fa50bb7eec801f2 Mon Sep 17 00:00:00 2001 From: slioch Date: Wed, 21 Oct 2009 14:59:40 -0700 Subject: fixed script to handle multiple entries for same priority --- scripts/priority.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts/priority.pl') diff --git a/scripts/priority.pl b/scripts/priority.pl index a8cf9b6..59239bf 100644 --- a/scripts/priority.pl +++ b/scripts/priority.pl @@ -9,8 +9,8 @@ foreach my $f (@files) { if (defined $result && length($result) != 0) { my @r = split " ", $result; if (defined $r[1]) { - $pri{$r[1]} = $f; #stuff in hash here + push @{$pri{$r[1]}},$f; } } } @@ -19,7 +19,10 @@ foreach my $f (@files) { #now sort foreach my $key ( sort { $a <=> $b } keys %pri ) { - my $loc = substr($pri{$key},0,-10); - my $loc = substr($loc,39); - print $key," ",$loc,"\n"; + my @a = @{$pri{$key}}; + foreach my $val (@a) { + my $loc = substr($val,0,-10); + my $loc = substr($loc,39); + print $key," ",$loc,"\n"; + } } -- cgit v1.2.3