OverlordQ has asked for the wisdom of the Perl Monks concerning the following question:
Do I need to read the file in, unlink, open up a write handle and then write it back?foreach my $file (@files) { open(FILE,"+<$file"); my @stream = <FILE>; my $stream = join '', @stream; $stream =~ s/(<iframe.*iframe>)//s; print FILE $stream; close(FILE); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Clobber instead of append
by Tanktalus (Canon) on May 26, 2005 at 03:51 UTC | |
|
Re: Clobber instead of append
by Mr_Person (Hermit) on May 26, 2005 at 03:58 UTC | |
|
Re: Clobber instead of append
by astroboy (Chaplain) on May 26, 2005 at 04:23 UTC |