in reply to Converting FILEHANDLE to string

Maybe I'm seeing this wrong, but why not search and replace instead of backing the file up? So, something like:
open (FILE, "<$file") or die "Can't open $file"; open (FILE_BU, ">$file_bu") or die "Can't open $file_bu"; while (<FILE>) { $_ =~ s/search/replace/g; print FILE_BU "$_"; } close FILE_BU; close FILE;
Then you could copy (or move) the new file over the old one, or check the result visually and do that manually.

Update: Especially with huge files, I would actually prefer this method over the "my @file = <FILE>" part.

--
B10m