That works if the replacement is character for character. You may be surprised by the results if the replacements are shorter than the original value.
open (A, '+<', "somefile.html") or die $!; s/a/b/g for my @records = <A>; seek(A, 0, 0); ### truncate (A, 0) or die "can not truncate file to zero length\n"; ### print A @records;
In reply to Re^2: perl open mode
by snopal
in thread perl open mode
by zer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |