in reply to DIY Tie
While not a marvellous example, it should give you some idea of how to partially edit a file. See. open, tell and seek for more info.open( my $fh => '+<', $your_file ) or die "ack: $!"; ## read up to a point read_stuff() or last while <$fh>; ## remember where you were my $last_pos = tell $fh; my $rest_of_file = do { local $/; <$fh> }; $rest_of_file =~ s<$a_regex>($replace); ## go back to where you were seek $fh => $last_pos, 0; print {$fh} $rest_of_file; close $fh;
_________
broquaint
|
|---|