Truncate Last few lines

2011-05-20 Thread Ambuli
Here i paste a perl script to delete last Two Lines. If you want delete more lines in a file you can specify it. use File::ReadBackwards; my $filename = 'test.txt'; my $Lines_to_truncate = 2; # Here the line to truncate is mean Remove only Last Two Lines my $bw = File::ReadBackwards-new(

Re: Truncate Last few lines

2011-05-20 Thread Shlomi Fish
Hi Ambuli, a few comments on your code: On Friday 20 May 2011 14:37:52 Ambuli wrote: Here i paste a perl script to delete last Two Lines. If you want delete more lines in a file you can specify it. Always start with use strict; and use warnings. use File::ReadBackwards; Include some

Re: Truncate Last few lines

2011-05-20 Thread C.DeRykus
On May 20, 4:37 am, cmksw...@gmail.com (Ambuli) wrote: Here i paste a perl script to delete last Two Lines. If you want delete more lines in a file you can specify it. use File::ReadBackwards;  my $filename = 'test.txt';  my $Lines_to_truncate = 2; # Here the line to truncate is mean Remove