Tom Smith wrote:
> John W. Krahn wrote:
>>
>> You could use some of Perl's idioms to do what you want:
>>
>> #!C:\Perl\bin\perl.exe
>> use strict;
>> use warnings;
>>
>> @ARGV = glob 'maillog*' or die "No maillog files found.\n";
>>
>> while ( <> ) {
>> print if /(?:imapd|pop3d).*?Log.*?user/;
John W. Krahn wrote:
Tom Smith wrote:
I'm writing a Perl script to parse 31 maillog files. The files are named
maillog, maillog.1, and so on up to 31. This is the default logrotate
scheme for naming rotated logs.
My current order for processing these files is this:
1) Open the directory.
2)
Rob Dixon wrote:
>
use strict;
use warnings;
use Carp;
my @maillog = do {
opendir my $dh, '.' or croak "Can't open directory: $!";
grep /^maillog/, readdir $dh;
};
my @parsedmail;
foreach my $log (@maillog) {
open my $fh, $log or croak "Can't open $log: $!";
while (<$fh>) {
if
Tom Smith wrote:
>
> I'm writing a Perl script to parse 31 maillog files. The files are named
> maillog, maillog.1, and so on up to 31. This is the default logrotate
> scheme for naming rotated logs.
>
> My current order for processing these files is this:
>
> 1) Open the directory.
> 2) List mail
Tom Smith wrote:
> I'm writing a Perl script to parse 31 maillog files. The files are named
> maillog, maillog.1, and so on up to 31. This is the default logrotate
> scheme for naming rotated logs.
>
> My current order for processing these files is this:
>
> 1) Open the directory.
> 2) List maill
-Original Message-
From: Tom Smith [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 07, 2007 5:09 PM
To: beginners@perl.org
Subject: Opening multiple files for parsing
I'm writing a Perl script to parse 31 maillog files. The files are named
maillog, maillog.1, and so on up to 31. This