Note that neither your code nor mine works in a multi-thread/process environment. Not enough flocking. {grin}{ local *ARGV; @ARGV = "yourfilenamehere"; local $/; local $^I = ".bak"; # or "" if you don't want the backup $_ = <ARGV>; # truncate $_ as you wish: it's the entire file print; }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to •Re: Truncate the front of a file
by merlyn
in thread Truncate the front of a file
by flocto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |