mdchachi has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl $home="/home/epcom"; $log="$home/access-mc"; $savelog="$home/log/access-mc"; open (LOGF,"$log") || die "[45]Open Error $log"; open (SAVEF,">>$savelog") || die "[45]Open Error $savelog"; close (SAVEF); open (SAVEF,"$savelog"); while (<SAVEF>) { # !!!it waits for standard input here, at the eof() call # but just once $last=$_ if eof(); } close (SAVEF); $lineno = 0; if ($last =~ /^....*/) { chop $last; while (<LOGF>) { if (m/\Q$last/) { $lineno = $.; $lineno = $.; } } } close (LOGF); open (SAVEF,">>$savelog"); open (LOGF,"$log"); while (<LOGF>) { print SAVEF if ($. > $lineno && ! /\.jpg|\.gif/ ) ; } close (SAVEF); close (LOGF); exit 0;
Edit: chipmunk 2001-04-11
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Behavior change in 5.6??
by athomason (Curate) on Apr 12, 2001 at 03:57 UTC | |
by mdchachi (Initiate) on Apr 12, 2001 at 06:24 UTC | |
|
Re: Behavior change in 5.6??
by Beatnik (Parson) on Apr 12, 2001 at 12:30 UTC |