in reply to Suffering with buffering - how to wake 'less'
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Suffering with buffering - how to wake 'less'
by benizi (Hermit) on Jan 13, 2010 at 19:43 UTC | |
by BrowserUk (Patriarch) on Jan 13, 2010 at 19:59 UTC | |
by benizi (Hermit) on Jan 13, 2010 at 23:23 UTC | |
by ikegami (Patriarch) on Jan 13, 2010 at 20:40 UTC |