The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 02-01-2008
KevinADC KevinADC is offline
Registered User
 

Join Date: Jan 2008
Posts: 338
You would use the Tie::File module. The Tie::File documentation should explain it.

Or you could read the file into an array and use an array slice to remove the lines:

open(FH,'file');
@array = <FH>;
close FH;
open(OUT,'>','file');
print OUT @array[4..$#array-2];
close OUT;
Reply With Quote