in reply to problem using seek on some systems
How about
my $seek_loc = (-s FILE) - $bytes; $seek_loc = 0 if $seek_loc < 0; seek(FILE, $seek_loc, 0);
By the way, you should use lexical variables and 3-arg open whenever possible.
open(my $fh, '<', $file_name) or die("Unable to read log file \"$file_name\": $!\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problem using seek on some systems (portable)
by tye (Sage) on Dec 06, 2006 at 22:42 UTC | |
by Anonymous Monk on Dec 06, 2006 at 23:32 UTC | |
|
Re^2: problem using seek on some systems
by lokiloki (Beadle) on Dec 06, 2006 at 22:00 UTC | |
by ikegami (Patriarch) on Dec 06, 2006 at 22:59 UTC |