in reply to Re: Never, never, never
in thread Never, never, never
The trouble is that a lot of beginning perl scripts are mixtures of back-ticks and perl output -- an early use for me was an attempt at adding some readable column descriptions to the output of a unix command-line utility. What happens with buffering turned on is that you get the output from these two sources intermixed in an almost random fashion. And the reason this is happening is not at all obvious, in fact I would argue it's nearly impossible to figure out -- even if it occurs to you to read the docs for the special variables, there's nothing about the writeup for "$|" that would leap out at you (do I want my "pipes to be piping hot?").
So this is a hard one... if the default were different, perl might have an undeserved reputation for slow output, but as it is there's a nasty little gotcha in there. I tend to shut off $| for all my command line scripts... though of course you probably *shouldn't* do that in something like a CGI script.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Never, never, never
by chromatic (Archbishop) on Apr 25, 2005 at 18:27 UTC | |
by bluto (Curate) on Apr 25, 2005 at 19:51 UTC |