What you saw is the stringification, which is not necessarily the same thing. For instance:
But if instead I use x to peek at the globref in the debugger, it looks like this:my $x = \*FH; print "plain glob ref: <$x>\n"; # prints: plain glob ref: <GLOB(0x1d6c660)> open ($x, "<","somefile") or warn "error\n"; print "open FH ref: <$x>\n"; # prints: open FH ref: <GLOB(0x1d6c660)>
...which is much more interesting.my $x = \*FH; x $x # prints: #0 GLOB(0x1d6c408) # -> *main::FH open ($x, "<","somefile") or warn "error\n"; print "open FH ref: <$x>\n"; # prints: 0 GLOB(0x1d6c408) -> *main::FH FileHandle({*main::FH}) => fileno(6)
What do you get in your code?
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Re: Passing a file handle to a sub. I still don't get it.
by QM
in thread Passing a file handle to a sub. I still don't get it.
by rvosa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |