|
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;
|