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
In reply to Re: Search a file with ids from another file
by RL
in thread Search a file with ids from another file
by sigzero
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |