johngg has asked for the wisdom of the Perl Monks concerning the following question:
while (<IN>) { print OUT; }
but when converted to
while (<$inFH>) { print $outFH; }
I get a series of GLOB(0x180834) strings printed to STDOUT. The print does not seem to recognise the scalar as a filehandle in this situation and prints it's contents instead. Doing
while (<$inFH>) { print $outFH $_; }
gets around the problem but it seems a pity that such a common behaviour no longer works. I have looked at the documentation but can't see anything describing this behaviour. Am I missing something obvious?
Cheers,
JohnGG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bareword vs. Indirect Filehandle behaviour
by shmem (Chancellor) on Sep 19, 2006 at 10:04 UTC | |
by johngg (Canon) on Sep 19, 2006 at 10:37 UTC | |
by rodion (Chaplain) on Sep 19, 2006 at 10:57 UTC | |
by chromatic (Archbishop) on Sep 19, 2006 at 17:01 UTC | |
by johngg (Canon) on Sep 19, 2006 at 11:04 UTC | |
|
Re: Bareword vs. Indirect Filehandle behaviour
by ikegami (Patriarch) on Sep 19, 2006 at 15:50 UTC |