in reply to Re: sub routine to sort per time
in thread sub routine to sort per time
Thanks a lot moritz, I updated the messages several times, sorry for the trouble
However, I can't understand why $n is 0
my %in; while (<$INFILE>){ m[(\d\d:\d\d) (.+)$] and push @{ $in{ $1 } }, $2 ; print STDOUT "1 is $1\n"; print STDOUT "2 is $2\n"; } my @keys = keys %in; my @times = sort @keys; foreach my $hr (@times) { print STDOUT "hr is $hr\n"; my $n = $#{ $in{ $hr } }; } __DATA__ 11:10 A1 11:30 E4 11:30 Z4 11:50 H5 12:02 H6 12:25 B2 12:25 A8 12:30 F3 12:30 E7 12:50 E15 12:55 E16
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: sub routine to sort per time
by moritz (Cardinal) on Nov 26, 2008 at 10:53 UTC | |
|
Re^3: sub routine to sort per time
by BrowserUk (Patriarch) on Nov 26, 2008 at 11:05 UTC | |
|
Re^3: sub routine to sort per time
by moritz (Cardinal) on Nov 26, 2008 at 11:02 UTC |