Greetings. I have a simple script which tries to save my html log before my ISP discards it. It looks up the last line in my saved file, finds that line in the html file and appends to my saved file from that point. It works fine on version "5.005_03 built for i386-linux" but on a different machine running "v5.6.0 built for i686-linux" it stops and waits for standard input at one point. If I press enter once it then completes. What is going on? I am not passing any arguments to my script whatsoever. Here is the script. The stopping point is indicated. Many thanks.
#!/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