I know if you run `perldoc $SCRIPT` it will use $PAGER (or $PERLDOC_PAGER, etc...see the perldoc perldoc :) But how to make pod2usage pipe into a pager?
Many thanks, as always,
~Jeff
-output
A reference to a filehandle, or the pathname of a file to
which the usage message should be written. The default is
\*STDERR unless the exit value is less than 2 (in which case
the default is \*STDOUT).
Sending the data to STDOUT will allow it to go to the pager. Alternatively, you can redirect STDERR in your shell. E.g. in bash:
your_program.pl 2>&1 | less
Looking at the documentation, there's an -output option that takes a filehandle to which to write. Try opening a pipe to $ENV{PAGER} || "more" and passing that filehandle to pod2usage.
perlmonks.org content © perlmonks.org and Fletch, friedo, HuckinFappy
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03