http://qs1969.pair.com?node_id=646810


in reply to Re: perl open mode
in thread perl open mode

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;