in reply to Search a file with ids from another file
Hi,
foreach my $prime_id ( @id_hits ) { $line = shift @log until $line =~ /$prime_id/;
you're shifting elements off @log on the first run.
@log gets shortened this way.
Think of the first $prime_id not found in the logfile at all this will result in @log being empty on the second run of the foreach loop. Did you consider this?
I'm not sure about the structure of $prime_id's in relation to the logfile's content but it may result in some unpredictable results.
Hope this helps.
RL
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Search a file with ids from another file
by sigzero (Novice) on May 07, 2007 at 18:51 UTC | |
by blazar (Canon) on May 07, 2007 at 19:21 UTC | |
by sigzero (Novice) on May 07, 2007 at 20:17 UTC | |
by blazar (Canon) on May 07, 2007 at 20:44 UTC |