Thread In Datei suchen und einfügen
(11 answers)
Opened by holger at 2009-05-25 17:34
Was Linuxer meint:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 my $file="test.dat"; my $insert="foo"; { local $/ = undef; open(my $fh, '<', $file) or die "$!"; my $data = <$fh>; $data=~s/<\/body>/$insert\n<\/body>/; open(my $fh,'>',$file) or die "$!"; print $fh $data; close($fh); } |