Regarding STDOUT and indirect object notation for printby romandas (Pilgrim)
|on Dec 29, 2009 at 20:09 UTC||Need Help??|
romandas has asked for the
wisdom of the Perl Monks concerning the following question:
Not trying to do anything "useful" here, just experimenting with Perl a bit. I read in Intermediate Perl (p. 146) that the print function (as well as many of the built-in operations on filehandles) are actually just using Perl's indirect object notation to call the print method on the filehandle object.
So, I was curious to see whether this worked with the standard filehandles; STDOUT in particular. However:
didn't work. Nor did:
or even (not that I expected this to):
So, what gives? I checked perlfaq5, IO::Handle, and perldata but didn't see anything that answered my question specifically. Is there something I'm doing wrong or are the STD* filehandles "special" in some way?
Update: Thanks, all!