Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989743]
help
Chatterbox?
[choroba]: Dangers of WFH: a mailman rings, brings a parcel for my wife, I need to go outside, take my son with me, sign a paper *and* into the postman's mobile app, get back. Guess what the soup was doing meanwhiles?
[Discipulus]: soup without heat protections as CPUs are doomed to burned..
[1nickt]: The dangers of milk-based soup, you mean?
[Corion]: choroba: Ouch! But you don't need that many external events for that. I have on several occasions set up milk to cook and then programmed a bit, only to find the milk burned and congealed over the stove :-/
[choroba]: it's still edible, just need to scour the pot
[1nickt]: Corion I have a large site I need to check for broken links and absolute links. Making a scraper is easy of course; a spider that crawls a whole site is a little more involved ... I was planning a queue-based tool. Intersted to see what you do...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2017-10-18 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (244 votes). Check out past polls.

    Notices?