myocom has asked for the wisdom of the Perl Monks concerning the following question:
In trying to come up with a solution to print 'more'., I found myself looking at the results of this one-liner:
Win32: perl -e"open STDOUT, '| more'; print qq($_\n) for (1..1000)"Unix: perl -e'open STDOUT, "| more"; print qq($_\n) for (1..1000)'
Can anyone explain what the heck is happening around line 850 or so (the exact line seems to vary depending on your OS and possibly on your window size)? I thought perhaps it had something to do with buffering, but adding a $|++ in there doesn't seem to affect it a-tall.
"One word of warning: if you meet a bunch of Perl programmers on the bus or something, don't look them in the eye. They've been known to try to convert the young into Perl monks." - Frank Willison
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Piping STDOUT to 'more'
by zengargoyle (Deacon) on Mar 20, 2002 at 23:55 UTC | |
by ariels (Curate) on Mar 21, 2002 at 10:20 UTC | |
by myocom (Deacon) on Mar 21, 2002 at 01:07 UTC |
Back to
Seekers of Perl Wisdom