in reply to Modify file without any temp variable
Your version works fine. The following is a little more succinct:
use strict; use warnings; my $fileName = "test.txt"; open (JE, "+< $fileName") || die "Can not open the file "; my $ou = join "", <JE>; $ou=~s/findtext/changetext/gs; seek JE, 0, 0; print JE $ou; close (JE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Modify file without any temp variable
by tulsyan (Beadle) on Jul 20, 2005 at 07:32 UTC | |
by gopalr (Priest) on Jul 20, 2005 at 07:35 UTC |