This sequence seems to work for me:
open my $fh, '+<', $theFile or die $!; my $stuff = do{ local $/; <$fh> }; truncate $fh, 0; close $fh;
In reply to Re: Read entire file then clear while flocking
by BrowserUk
in thread Read entire file then clear while flocking
by citycrew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |