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

Hi Monks.

In a script I'm working on, I have a LOT of text that I need to output to the console. I need a way to output, say, only 25 lines of it at a time, wait for the user to push enter, output another 25 lines, wait for the user to push enter, etc., etc.

Does anyone know of a convenient way of doing this? I looked in the Text:: and Term:: namespaces but couldn't find anything.

Any help is appreciated.

Replies are listed 'Best First'.
Re: Buffered output to the console?
by arthas (Hermit) on May 25, 2003 at 23:55 UTC
    You can try the module IO::Page, which pipes your output to a pager (the one in $ENV{'PAGER'} if defined).

    Michele.
Re: Buffered output to the console?
by little (Curate) on May 25, 2003 at 23:33 UTC

    ./myscript.pl | more
    see man more

    Have a nice day
    All decision is left to your taste

      Thank you!