in reply to Re: Re: Deleting last line of file
in thread Deleting last line of file


That was just a one-liner.

If you need to do something more sophisticated as part of a program you should try something like this.

#!/usr/bin/perl -w use strict; # Localised in-place edit { local $^I = ''; # or use '.bak' to save a back-up local @ARGV = 'somefile'; while (<>) { print unless eof; } } __END__

--
John.