Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: open, sleep, & print together cause an error

by arhuman (Vicar)
on Feb 10, 2001 at 04:14 UTC ( #57529=note: print w/replies, xml ) Need Help??


in reply to open, sleep, & print together cause an error


did you try select on LOG before forcing autoflush ($|++;)?
UPDATE : Forget this post, I took too much time to submit this one. And the question was answered during the looooong time I took to check my answer. :-(
  • Comment on Re: open, sleep, & print together cause an error

Replies are listed 'Best First'.
Re: Re: open, sleep, & print together cause an error
by zeno (Friar) on Feb 10, 2001 at 04:24 UTC
    Hi arhuman, this code ended up working, too. Now I have a couple of alternatives!:
    use strict; use warnings; open LOG,">foo.log" or die "can't open foo.log: $!"; my $selected = select(LOG); $|++; select($selected); while(1) { print LOG (localtime).": something\n"; sleep(5); }

    Thanks a lot, arhuman. -zeno

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2016-09-01 04:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found