in reply to Re^4: Regarding STDOUT and indirect object notation for print
in thread Regarding STDOUT and indirect object notation for print
Okay, so even though STDOUT is, by default, a blessed IO::Handle object, and thus possesses the methods described, perl needs to be directed to the IO::Handle module via the 'use' statement so it can find the definitions for those methods. Does that sum it up correctly?
Unfortunately, it's all wrong.
STDOUT isn't blessed. It's not a reference, so it can't be blessed. Globs only act as if they are blessed references.
Given a blessed reference or a glob, Perl knows where to look for the methods. For globs, it looks in the IO::Handle namespace.
Loading a module doesn't help Perl find anything. It typically loads subroutines. IO::Handle is no exception.
Perl knows where to look for the method (as indicated by the error message), but there's nothing to find (as indicated in the error message) because IO::Handle wasn't loaded (which isn't indicated in the error message).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Regarding STDOUT and indirect object notation for print
by romandas (Pilgrim) on Dec 29, 2009 at 23:47 UTC | |
by ikegami (Patriarch) on Dec 30, 2009 at 00:49 UTC | |
by jwkrahn (Abbot) on Dec 30, 2009 at 00:22 UTC |