in reply to Re: Dynamic File Handles
in thread Dynamic File Handles
$fh will be a random string generated during each loop Yes, what I am doing is stupid. I know that much :-) But its for a dirty dirty piece of code. I dont want to have to keep opening and closing files. Thanks!@files =qw (file1 file2 file3 file4); foreach(@files) { open ($fh, "$_"); while(<$fh>) { ... } close($fh); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Dynamic File Handles
by cmeyer (Pilgrim) on Jun 06, 2005 at 20:54 UTC |