in reply to Re^3: file handle var for print command
in thread file handle var for print command
Not quite.
They behave like IO::File objects (since 5.12).
$ perl -e'STDOUT->foo' Can't locate object method "foo" via package "IO::File" at -e line 1.
They do obey inheritance.
$ perl -e'use IO::File; IO::File::say( *STDOUT, "ok" )' Undefined subroutine &IO::File::say called at -e line 1. $ perl -e'use IO::File; IO::Handle::say( *STDOUT, "ok" )' ok $ perl -e'STDOUT->say( "ok" )' ok
(IO::Handle's docs is merely saying IO::File isn't a derivable class since My::IO::File->new will create an IO::File "object" instead of a My::IO::File object.)
And the issue raised wasn't why it works; it was about where it's documented. I could not find it either.
|
|---|