logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

IO::Pager::Page - Emulate IO::Page, pipe STDOUT to a pager if STDOUT is a TTY

Author

       Jerrad Pierce <jpierce@cpan.org>

       Florent Angly <florent.angly@gmail.com>

       This module inspired by Monte Mitzelfelt's IO::Page 0.02

Description

       IO::Pager was designed to programmatically decide whether or not to point the STDOUT file handle into a
       pipe to program specified in the PAGER environment variable or one of a standard list of pagers.

Name

       IO::Pager::Page - Emulate IO::Page, pipe STDOUT to a pager if STDOUT is a TTY

See Also

       IO::Page, IO::Pager, IO::Pager::Unbuffered, IO::Pager::Buffered

Synopsis

       Pipes STDOUT to a pager if STDOUT is a TTY

Usage

         BEGIN {
           use IO::Pager::Page;
           # use I::P::P first, just in case another module sends output to STDOUT
         }
         print<<HEREDOC;
         ...
         A bunch of text later
         HEREDOC

       If you wish to forgo the potential for a BrokenPipe foible resulting from the user exiting the pager
       prematurely, load IO::Pager::Page like so:

         use IO::Pager::Page hush=>1;

See Also