Hi, whats the quickest way to delete the last two cahracters of a file (without reading the whole thing in and spitting it out again?) . Any perl gurus out there?
thanks...
Perl question%26gt; whats the quickest way to delete the last two characters in a file? (it needs to be quick)?
my $filename = "... whatever ...";
truncate $filename, (stat($filename)-%26gt;size) - 2;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment