in reply to In-place file manipulation

Maybe File::Data will be usefull for you:
use File::Data; use strict; use File::Data; my $o_dat = File::Data->new('./t/example'); $o_dat->write("complete file contents\n"); $o_dat->prepend("first line\n"); # line 0 $o_dat->append("original second (last) line\n"); $o_dat->insert(2, "new second line\n"); # inc. zero! $o_dat->replace('line', 'LINE'); print $o_dat->READ;
      
--------------------------------
SV* sv_bless(SV* sv, HV* stash);