numlock00 has asked for the wisdom of the Perl Monks concerning the following question:
The outer loop is working fine. It will run through every element of the array. The inner loop, however, only runs once. Even though the outer loop finishes inormally, the inner loop does not repeat. Any help appreciated.
Here it is:foreach $hour (@hourRange) { $timeBlock = $timeDateBase . $hour; print "$timeBlock\n"; while (<LOG>) { chomp; if ($_ =~ /$timeBlock/) { print "$timeBlock\n"; ($a,$b,$c) = split(/"/, $_); if ($a =~ /^(\S+)\s-\s-\s\[(\S+)\s/) { $IP = $1; $timeString = $2; print "$IP\n"; print "$timeString\n"; } } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Nested loop won't repeat
by Corion (Patriarch) on Jul 14, 2008 at 11:51 UTC | |
by numlock00 (Initiate) on Jul 15, 2008 at 03:19 UTC | |
|
Re: Nested loop won't repeat
by massa (Hermit) on Jul 14, 2008 at 12:47 UTC | |
|
Re: Nested loop won't repeat
by apl (Monsignor) on Jul 14, 2008 at 12:10 UTC | |
by numlock00 (Initiate) on Jul 15, 2008 at 03:18 UTC | |
|
Re: Nested loop won't repeat
by ikegami (Patriarch) on Jul 15, 2008 at 03:28 UTC |