pr19939 has asked for the wisdom of the Perl Monks concerning the following question:
$fileArray; my $totlogfile = "$today-TotalLogFile"; my $totlogfile1 = "today-TotalLogFile1"; my $totlogfilebkup="TotalLogFileBkup"; open(total,">$totlogfilebkup") || die("Could not open out file!$outfil +e");#outfile is declared before opendir(DIR, "logfiles") or die "couldn't open logs"; while ( defined ($filename = readdir(DIR)) ) { $index = index($filename,$yesterday); if ($index > -1) { $fileArray[$count] = $filename; $count = $count + 1; print "The log file name is $filename.\n"; open(logfile,"$filename") || die("Couldx not ope +n file! $logfilename");#$logfilename declared while($line = <logfile>) { chomp($line); unless(( $line =~ /\.gif/i ) || ( $line =~ + /\.jpg/i ) || ( $line =~ /\.jpeg/i ) || ( $line =~ /\.js/i ) || ( $l +ine =~ /\.css/i ) || ( $line =~ /tickerServlet/i ) || ( $line =~ /nag +ios/i ) || ( $line =~ /statusservlet/i )) { print total "$line\n"; + } } close logfile; } } closedir(DIR); close total;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Filter File Using HASH
by cog (Parson) on Feb 01, 2005 at 12:06 UTC | |
|
Re: Filter File Using HASH
by holli (Abbot) on Feb 01, 2005 at 12:08 UTC | |
by pr19939 (Initiate) on Feb 01, 2005 at 13:02 UTC | |
by holli (Abbot) on Feb 01, 2005 at 13:05 UTC | |
|
Re: Filter File Using HASH
by holli (Abbot) on Feb 01, 2005 at 13:52 UTC | |
by pr19939 (Initiate) on Feb 01, 2005 at 14:01 UTC | |
by holli (Abbot) on Feb 01, 2005 at 14:11 UTC | |
by pr19939 (Initiate) on Feb 01, 2005 at 14:29 UTC | |
by holli (Abbot) on Feb 01, 2005 at 15:46 UTC | |
|
Re: Filter File Using HASH
by pr19939 (Initiate) on Feb 01, 2005 at 13:19 UTC |