This has problems if your file/string is huge. There is also a Tie::Slurp module or somesuch but I admit I haven't had it working yet.use File::Slurp; my $string = read_file("yourfile"); write_file("yourfile.bak", $string); $string =~ s/everything/otherthings/g; $string .= "endbit\n"; write_file("newfile", $string);
In reply to Re: Converting FILEHANDLE to string
by quinkan
in thread Converting FILEHANDLE to string
by joev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |