in reply to Lexical filehandles: unblessed but (sometimes) can
$fh contains a reference to a glob. The glob isn't blessed. However, the IO object referenced by the glob is blessed.
$ perl -MScalar::Util=blessed,reftype -E' open my $fh, ">", \my $buf; say reftype($fh) // "[not a ref]"; say blessed($fh) // "[not blessed]"; say reftype(*$fh{IO}) // "[not a ref]"; say blessed(*$fh{IO}) // "[not blessed]"; ' GLOB [not blessed] IO IO::File
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Lexical filehandles: unblessed but (sometimes) can
by vr (Curate) on Mar 15, 2018 at 21:02 UTC | |
by ikegami (Patriarch) on Mar 16, 2018 at 20:18 UTC | |
by vr (Curate) on Mar 17, 2018 at 13:45 UTC |