alih110 has asked for the wisdom of the Perl Monks concerning the following question:
---------------------- Background: The above code is in a perl module whose multiple instances are running in parallel through LSF. So each call of the module should generate a unique file handle with which to open the same file in read mode.$seed = (time() ^($$ + ($$ <<15))); $fh = "FH_TEST".$seed; open (local $fh, "test.out"); while (<$fh>) { .............. .............. } close $fh;
20080820 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Generate unique file handles
by moritz (Cardinal) on Aug 20, 2008 at 07:17 UTC | |
by alih110 (Novice) on Aug 20, 2008 at 08:23 UTC | |
by moritz (Cardinal) on Aug 20, 2008 at 08:28 UTC | |
|
Re: Generate unique file handles
by Anonymous Monk on Aug 20, 2008 at 07:15 UTC | |
|
Re: Generate unique file handles
by bruno (Friar) on Aug 20, 2008 at 19:13 UTC | |
|
Re: Generate unique file handles
by ikegami (Patriarch) on Aug 21, 2008 at 20:06 UTC |