On Aug 10, Tyler Longren said:

>while (<LOGFILE>) {
>      chomp;
>      push (@array, $_)
>      if m/ida/i;
>}

>while (<LOGFILE>) {
>      push (@scans, $_)
>      if m/$last_host/i;
>}

Is there a reason you didn't put both of those into ONE while block?  It
would be far more efficient (and it would work).

The problem is that you have to rewind the file to read from it again.

  seek LOGFILE, 0, 0;  # start the the beginning of the file again

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to