in reply to Simple Way to Paginate Output?

I thought that there surely must be a command-line switch to tell "more" (or "less") not to buffer the first page,

It's not more that's buffering, it's your script writing to it — non-interactive output (the pipe here) is block-buffered by default.  Try adding

use IO::Handle; ... MORE->autoflush(); ...

Also, a quick CPAN search found IO::Page and IO::Pager.

Replies are listed 'Best First'.
Re^2: Simple Way to Paginate Output?
by bobdog (Initiate) on Jul 13, 2010 at 15:30 UTC

    Thank you so much!! The autoflush on the pipe is what I needed.

    The other annoying thing is the way that you can type ahead when more-ing. Is there a simple way to prevent this? I seem to recall years ago writing a command-line script that would clear the key input buffer before waiting for more input, but for the life of me I can't figure out what that trick was.