Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Can't use string ("main::STDOUT") as a symbol ref while "strict refs" in use

by GlitchMr (Sexton)
on Aug 25, 2012 at 18:27 UTC ( #989743=note: print w/ replies, xml ) Need Help??


in reply to Can't use string ("main::STDOUT") as a symbol ref while "strict refs" in use

select returns currently selected filehandle. Until you will select other filehandle, it's main::STDOUT. Because it's bareword filehandle, it's returned as string. When printing to it, print notices it's string and strict 'refs' is enabled, so it dies.

Instead, you can try workaround of using IO::Handle method. With Perl older than 5.14, you have to use IO::Handle - it's optional is Perl 5.14.

select->print(6)


Comment on Re: Can't use string ("main::STDOUT") as a symbol ref while "strict refs" in use
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989743]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-12-22 08:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (112 votes), past polls