Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: print() function hang for long time

by soonix (Curate)
on Feb 19, 2013 at 16:41 UTC ( #1019613=note: print w/ replies, xml ) Need Help??


in reply to Re^4: print() function hang for long time
in thread print() function hang for long time

Perhaps just on this machine, perl is configured differently (e.g. bigger buffers), or the operating system might add another level of buffers ...

"rc3" sounds like an init script, that would log to a file, wouldn't it? So that is usually buffered.

Most probably your login triggers other activities that make your "rc3" print additional messages, thus filling the buffer and writing it out to disk, and then your tty can see it.

(This section edited) In my previous msg I overlooked that you print also to a file handle and not only to STDOUT.
Put the $|=1; statement right after the "hanging" print statement, better yet, put it after both print statements in line 12 and 15, and give it a try.


Comment on Re^5: print() function hang for long time
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2014-09-18 19:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (122 votes), past polls