Dru has asked for the wisdom of the Perl Monks concerning the following question:
How I'm opening and processing compressed log files: open (FILE, "zcat $filename |") or die && error($file);
Thanks,The portion that reads the file starting from the bottom: # Run this portion if user chooses bottom if ($pos =~ /\bbottom\b|\bb\b/){ my $bw = File::ReadBackwards->new( $file ) or die "can't read $file: $!\n" ; while( defined( $log_line = $bw->readline ) ) { print $log_line ; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using File::ReadBackwards with Compressed Files
by Roger (Parson) on Mar 01, 2004 at 14:34 UTC | |
|
Re: Using File::ReadBackwards with Compressed Files
by matija (Priest) on Mar 01, 2004 at 14:46 UTC | |
|
Re: Using File::ReadBackwards with Compressed Files
by esskar (Deacon) on Mar 01, 2004 at 14:37 UTC |