S
Scott McGerik
I am using the First-Class Filehandle Trick, described at
http://perl.plover.com/local.html#3_The_First_Class_Filehandle_Tr.
In a particular program, I had this line:
$INFILE = do { local *FH }; $OUTFILE = do { local *FH };
I then proceed to open $INFILE for reading and $OUTFILE for writing with
unless ( open $INFILE, '<', $infile ) {
and
unless ( open $OUTFILE, '>', $outfile ) {
This worked in 5.6.1, but when I do the same under 5.8.0, I get the
following error message:
Filehandle FH opened only for output at ...
I find this confusing because I thought that
do { local *FH }
would return an unnamed glob. But from the error message, it appears
that it returned the glob for FH.
I looked through the perldelta file, at
http://www.perldoc.com/perl5.8.0/pod/perldelta.html, for 5.8, but I did
not find any hints. Pointers and explanations are appreciated.
Scott McGerik
http://perl.plover.com/local.html#3_The_First_Class_Filehandle_Tr.
In a particular program, I had this line:
$INFILE = do { local *FH }; $OUTFILE = do { local *FH };
I then proceed to open $INFILE for reading and $OUTFILE for writing with
unless ( open $INFILE, '<', $infile ) {
and
unless ( open $OUTFILE, '>', $outfile ) {
This worked in 5.6.1, but when I do the same under 5.8.0, I get the
following error message:
Filehandle FH opened only for output at ...
I find this confusing because I thought that
do { local *FH }
would return an unnamed glob. But from the error message, it appears
that it returned the glob for FH.
I looked through the perldelta file, at
http://www.perldoc.com/perl5.8.0/pod/perldelta.html, for 5.8, but I did
not find any hints. Pointers and explanations are appreciated.
Scott McGerik