Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
reading the contents into an array:open (FILE, "$file") || die "Error unable to open $file: $!\n";
Iterating over the array and writing to the same file:my @array = <FILE>; close FILE;
??open (WRITE, ">$file") || die "Error: Unable to open $file: $!\n"; foreach (@array) { print WRITE $_; } close WRITE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CTRL M characters ? (HTTP)
by tye (Sage) on Feb 01, 2005 at 00:21 UTC | |
|
Re: CTRL M characters ?
by Fletch (Bishop) on Jan 31, 2005 at 22:36 UTC | |
by itub (Priest) on Jan 31, 2005 at 22:48 UTC | |
|
Re: CTRL M characters ?
by nerfherder (Monk) on Jan 31, 2005 at 22:58 UTC |