Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: The delay of printing encountered using loop

by frozenwithjoy (Priest)
on Jun 25, 2012 at 22:02 UTC ( [id://978292]=note: print w/replies, xml ) Need Help??


in reply to The delay of printing encountered using loop

Probably overkill for a one-liner, but for something longer you can control flushing with the flush/autoflush-related functions/methods from IO::Handle. edit: one nice thing about this approach is that you can specify how different file handles get flushed. For example, auto-flushing log files only gives you up-to-date logs, but doesn't cause the performance penalty of auto-flushing file handles used for big data.
  • Comment on Re: The delay of printing encountered using loop

Replies are listed 'Best First'.
Re^2: The delay of printing encountered using loop
by morgon (Priest) on Jun 25, 2012 at 23:35 UTC
    one nice thing about this approach is that you can specify how different file handles get flushed.
    I agree that using IO::Handle methods is nicer but just the approach with $| allows for the same granularity.

    It is not the case that setting $| to true turns on autoflushing for all file-handles. It only affects the file-handle that had been selected (or STDOUT when none had been explicitely selected).

    see "perldoc -f select"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-16 18:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found