ady has asked for the wisdom of the Perl Monks concerning the following question:
foreach ...
open (FH, "<${file}.txt") or die "Can't open ${file}.txt: $!\n"; open (FH1, ">${file}1.txt") or die "Can't open ${file}1.txt: $!\n"; while (<FH>) { ...do stuff with $_... } close (FH) or die "Can't close ${file}.txt: $!\n"; close (FH1) or die "Can't close ${file}1.txt: $!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Collapsing multiple file open/close
by ikegami (Patriarch) on Apr 13, 2005 at 16:17 UTC | |
by ady (Deacon) on Apr 13, 2005 at 16:35 UTC | |
by ikegami (Patriarch) on Apr 13, 2005 at 16:44 UTC | |
by ady (Deacon) on Apr 13, 2005 at 16:53 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |