http://qs1969.pair.com?node_id=817033

benizi has asked for the wisdom of the Perl Monks concerning the following question:

The only thing that generally annoys me about the 'less' command (other than trying to google it) is that I can't figure out how to get it to not stop the program on the input end of its pipe. Take the following example:

perl -lwe 'print and /000$/ and warn "HERE$_\n" for 1..1e6' | less

HERE1000 through HERE14000 get printed to STDERR before less stops perl. Unbuffering output (select((select($_),$|=1)[0]) for STDOUT, STDERR) doesn't change anything.

perl isn't the program with which I'm having trouble, but hopefully what works for perl will point me in the right direction.