|
IO::Pager - Select a pager, optionally pipe it output if destination is a TTY |
IO::Pager - Select a pager, optionally pipe it output if destination is a TTY
#Select a pager, sets $ENV{PAGER}
use IO::Pager;
#Optionally pipe output
{
#local $STDOUT = IO::Pager::open *STDOUT;
local $STDOUT = new IO::Pager *STDOUT;
print <<" HEREDOC" ;
...
A bunch of text later
HEREDOC
}
IO::Pager is lightweight and can be used to locate an available pager and set $ENV{PAGER} (see NOTES) or as a factory for creating objects defined elsewhere such as the IO::Pager::Buffered manpage and the IO::Pager::Unbuffered manpage.
IO::Pager subclasses are designed to programmatically decide whether or not to pipe a filehandle's output to a program specified in $ENV{PAGER}. Subclasses are only required to support filehandle output methods and close, namely
close() of the filehandle.
print() to the filehandle.
printf() to the filehandle.
syswrite() to the filehandle.
For anything else, YMMV.
Instantiate a new IO::Pager to paginate FILEHANDLE if necessary. Assign the return value to a scoped variable.
See the appropriate subclass for implementation specific details.
Defaults to the IO::Pager::Unbuffered manpage.
An alias for new.
Explicitly close the filehandle, this stops any redirection of output on FILEHANDLE that may have been warranted. Normally you'd just wait for the object to pass out of scope.
This does not default to the current filehandle.
See the appropriate subclass for implementation specific details.
See NOTES for more information.
IO::Pager may fall back to these binaries in order if $ENV{PAGER} is not executable.
See NOTES for more information.
The algorythm for determining which pager is to use as follows:
less and the more manpage.
more
Steps 1, 3 and 4 rely upon $ENV{PATH}.
the IO::Pager::Buffered manpage, the IO::Pager::Unbuffered manpage, the IO::Pager::Page manpage
the IO::Page manpage, the Tool::Less manpage
Jerrad Pierce <jpierce@cpan.org>
This module is forked from IO::Page 0.02 by Monte Mitzelfelt
|
IO::Pager - Select a pager, optionally pipe it output if destination is a TTY |