rename renames, not copies.
Oops! My error. I did
print $fh_in $_;
where I meant to do
print $fh_out $_;
Both
my @lines = <$fh_in>; for (@lines) { s/// }
and
while(<$fh_in>) { s/// }
work a line at a time. The only difference is that the top version needlessly keeps the entire file in memory.
Entire file at once would be
my $text; { local $/; $text = <$fh_in>; } $text =~ s///g;
In reply to Re^3: modify file in place in script? Regex for changing includes from SSI to PHP
by ikegami
in thread modify file in place in script? Regex for changing includes from SSI to PHP
by hmbscully
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |