headybrew has asked for the wisdom of the Perl Monks concerning the following question:
When I look into using $| to flush STDOUT, I find stuff like this:
$old_handle = select (STDOUT); $| = 1; # perform flush after each write to STDOUT select ($old_handle); # restore previously selected handle
Why do I have to do all that selecting of file handles? If STDOUT is already selected by default, and I'm not changing to another handle, can't I just use:
What I'd really rather do is just flush STDOUT at will. But if theres a flush(STDOUT) function, I haven't seen it documented.$| = 1; print "some stuff\n"; print "some more stuff\n"; $| = 0;
I now humbly await your monkitudinous wisdom.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Lowering my STDards :)
by hossman (Prior) on Jun 29, 2007 at 20:55 UTC | |
|
Re: Lowering my STDards :)
by FunkyMonk (Bishop) on Jun 29, 2007 at 20:07 UTC | |
|
Re: Lowering my STDards :)
by msk_0984 (Friar) on Jun 30, 2007 at 06:45 UTC | |
|
Re: Lowering my STDards :)
by Anonymous Monk on Jul 02, 2007 at 15:28 UTC | |
by Anonymous Monk on Jun 09, 2008 at 09:02 UTC |