in reply to How do I truncate a flat file, then append to front?

Use Tie::File. Try something like this:

use Tie::File; $YOUR_LOG_LINE = "whatever you want.\n"; my @log; my $o = tie @log, 'Tie::File', 'log.dat' or die $!; $o->flock; # Default is conveniently LOCK_EX unshift @log, $YOUR_LOG_LINE; # Add line to beginning. $#log = 99 unless @log < 100; # Truncate to 100 lines if necessary.

But, no. That won't work with perl4. Upgrade. Everyone's doing it. ;-)

-sauoq
"My two cents aren't worth a dime.";