in reply to print problem

I won't pick nits about whether this makes STDOUT unbuffered, or merely behave as though it were unbuffered (yes, there is a difference), but in the spirit of T M T O W T D I:

$|=1;

is exactly equivalent to:

use English; $OUTPUT_AUTOFLUSH=1;

which is effectively the same as:

use FileHandle; STDOUT->autoflush(1);

It all boils down to how much typing you're up for vs. whether or not you'll remember what it means later.

dmm

You can give a man a fish and feed him for a day ...
Or, you can
teach him to fish and feed him for a lifetime

Replies are listed 'Best First'.
Re: Re: print problem
by Anonymous Monk on Dec 22, 2001 at 06:51 UTC

    except that (unless you are going to use them elsewhere)

    use English;  ...and...
    use FileHandle;

    both drag in a pile more (mostly useless) code... isn't

    $| = 1; #set autoflush on

    good enough?

      English isn't that bad. It could be made a little skimpier, though. Maybe I'll fix up its import slightly. Thanks for the idea!