Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: removing lines from a file

by g0n (Priest)
on Jun 22, 2005 at 17:30 UTC ( [id://469108] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
       ...if regex...
       seek(LOG,0,0) || die "Seek error: $!";
       ...process line...
       truncate(LOG,tell(LOG))
    
  2. or download this
       ...if regex...
       $pos = tell(LOG)
       seek(LOG,0,0) || die "Seek error: $!";
       ...process line...
       truncate(LOG,$pos)
    
  3. or download this
    truncate(LOG,$pos-$stringlength);