[EMAIL PROTECTED] wrote:
> Hi ,
> 
> 
> there is an existing file and I need to append  text to it ,only thing
> is I need to remove the last line of existing file and then need to
> append text.
> I hope I am  clear.If there are 6 lines in a file I have remove 6th
> line 
> and then need to append the text.

The Tie::File module (standard with 5.8 I think, otherwise install from
CPAN) will work great for this. You can use pop() to remove the last line
and then use push() to add the new lines.

http://search.cpan.org/~mjd/Tie-File-0.96/lib/Tie/File.pm

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to