English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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

2007-07-11 10:08:25 · 1 answers · asked by Dudeberry 2 in Computers & Internet Programming & Design

1 answers

my $filename = "... whatever ...";
truncate $filename, (stat($filename)->size) - 2;

2007-07-11 10:53:46 · answer #1 · answered by McFate 7 · 0 0

fedest.com, questions and answers