in reply to Opening files in 5.004 and 5.8
To minimise the amount of code you have to change, I would just conditionally bring in the Symbol module, and call gensym to initialise your file handle, and ditch the 'RPT' stuff.
use Symbol; sub printSumpn{ my($handle, $file) = (gensym(), '/tmp/report.txt');
And everything will work just fine. You don't actually care about what the handle itself looks like, just that it uniquely identifies whatever it's printing to. gensym does that for you.
• another intruder with the mooring in the heart of the Perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Opening files in 5.004 and 5.8
by educated_foo (Vicar) on May 12, 2007 at 17:35 UTC | |
by gaal (Parson) on May 12, 2007 at 18:48 UTC |