Try this:
#! perl -sw use strict; use threads; use Thread::Queue; my $Q = new Thread::Queue; async{ $Q->enqueue( $_ ) while <>; $Q->enqueue( undef ); }->detach; sleep 1; print while $_ = $Q->dequeue;
Name it buf(.pl) and use it like this:
perl -E"$_%1000 or say 'Here'. $_ for 1..1e6" | buf | less
In reply to Re: Suffering with buffering - how to wake 'less'
by BrowserUk
in thread Suffering with buffering - how to wake 'less'
by benizi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |