Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Perl Idioms Explained - $|++

by ctilmes (Vicar)
on Aug 01, 2003 at 23:23 UTC ( #280189=note: print w/replies, xml ) Need Help??


in reply to Re: Perl Idioms Explained - $|++
in thread Perl Idioms Explained - $|++

If they don't know that "AUTOFLUSH" flushes the output automatically, they probably don't know what the heck "UNBUFFERED" means.

(And the converse -- if they have any clue what flushing is at all, they probably know what "AUTOFLUSH" means.)

Replies are listed 'Best First'.
Re^3: Perl Idioms Explained - $|++
by petrw1 (Initiate) on Apr 13, 2018 at 19:23 UTC
    Can you tell me if I need to specify the $|++ (or equivalent) in "ALL" perl scripts within a process; or only the main driver. I have about 50 perl scripts several layers deep (i.e. "A" invokes "B" which invokes "C" and "D" and "E" etc.....) By the way I have tried it in a few scripts with no luck yet ... the output to my screen still only displays every 50 lines or so. Are they any gotcha's? Thanks Wayne

      $| works per process. So if you use one script that sources other scripts (e.g. using do $filename, require, eval $string), once is sufficient. If you start scripts from other scripts using system, exec, qx a.k.a. ``, pipe open (| somewhere in the open arguments), each script runs in its own process and thus has its own $|.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://280189]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2018-05-27 23:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?