On Aug 31, Jim said:

>open (FILE, "+>",  $file) or die "cannot open $file: $!";

I think you want "+>>" there, or else it will overwrite the contents of
the file and you won't be able to determine how many lines there were
originally.

>flock (FILE, 2) or die "cannot flock $file: $!";

For safety's sake, use Fcntl's flock() constants.

-- 
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %    -- Meister Eckhart


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to