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

Re: Delayed writes

by Helter (Chaplain)
on Oct 28, 2002 at 18:13 UTC ( [id://208573]=note: print w/replies, xml ) Need Help??


in reply to Delayed writes

You don't show code...but a suggestion, setting $| only works on the currently selected file handle, so make sure you are doing something like:
select( FILEHANDLEFORMYFILE ) $| = 1; select( STDOUT ); # I always like to set things back to how they were +before

Hope this helps!

Replies are listed 'Best First'.
Re: Re: Delayed writes
by fruiture (Curate) on Oct 28, 2002 at 18:23 UTC
    I always like to set things back to how they were

    Then the following should be much better, because it really resets the selected handle, no matter which was selected.

    my $oh = select( WHATEVER ); $| = 1; select($oh); # or even (might be regarded as obfu) : select( ( select( WHATEVER ), $| = 1 )[0] );
    --
    http://fruiture.de
Re: Re: Delayed writes
by SpaceAce (Beadle) on Oct 28, 2002 at 18:50 UTC
    Ooooooh, that might be the glaringly obvious thing I am missing :)

    (Note: yep, it was)
    It's just like that feeling you get when you leave the house and you just KNOW you forgot something...

    Just for the record, I didn't post any code because the workhorse function where this is going on is a couple of hundred lines long and I was hoping to get a general suggestion like yours.

    Thanks for the help.

    SpaceAce

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-24 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found