Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

by petrw1 (Initiate)
on Apr 13, 2018 at 19:23 UTC ( [id://1212830]=note: print w/replies, xml ) Need Help??

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

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

Replies are listed 'Best First'.
Re^4: Perl Idioms Explained - $|++
by afoken (Chancellor) on Apr 14, 2018 at 09:33 UTC

    $| 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 $|.


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

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-06-19 05:01 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.