>>>>> "Ron" == Ron McKeever <[EMAIL PROTECTED]> writes:

Ron> I am trying to figure out my Perl parsing script to dump the
Ron> interesting part of my log files to another parsed file.
[...]

Ron> But I get errors...

I am affraid You have to solve this issue in any case.

Ron> Is there an easier way do to this? These log files get to around
Ron> 500MB a day so the fastest way is hoped. Would a while <> be
Ron> better??

Maybe opening in "follow" mode (ie. calling "tail -f") would help? You
launch your script in the morning when the log file is small and it
gathers new lines when they are written. It depends how the input log
file is written, and the syntax of the file, of course. New lines have
to be appended to it by your system.

  $infile = "tail -fn +1 $file |";
  open LOG, $infile or die "Cannot open log $file, $!\n";
  while ( $line = <LOG> ) {
  # parse one line, write the result
  }

Hope it helps.
-- 
        Claude

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to