note
ikegami
<blockquote><p><i>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?</i></blockquote>
<p>Unfortunately, it's all wrong.
<ul>
<li>
<p>STDOUT isn't blessed. It's not a reference, so it can't be blessed. Globs only act as if they are blessed references.
<li>
<p>Given a blessed reference or a glob, Perl knows where to look for the methods. For globs, it looks in the IO::Handle namespace.
<li>
<p>Loading a module doesn't help Perl find anything. It typically loads subroutines. IO::Handle is no exception.
</ul>
<p>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).
814812
814820