in reply to perldoc Bold, Italic etc

Looks like all the pod formatters (man, color, ansi) ignore the user-specified pager colors. I have $LESS_TERMCAP_mb, etc defined and they work great on regular manpages, but perldoc ignores them. I also tried adding the color commandline switches in $LESS and still no luck. Seems like a bug to me. But not sure if it's in the Pod-Perldoc or podlators.

Replies are listed 'Best First'.
Re^2: perldoc Bold, Italic etc
by Anonymous Monk on May 08, 2025 at 15:16 UTC
    This works great:
    function perldoc() { command perldoc -n less "$@" |man -l -; }
    Except it's not portable because the version of man included with the BSDs (including macOS) doesn't support reading manpages from stdin. Switching from a pipeline to temp files should be portable.

    With a recent groff version (>=1.23), this also works:

    GROFF_NO_SGR=1 perldoc -oman ...
    Older versions of groff support the -c flag, but Pod::Perldoc::ToMan would need to be updated to allow the user to specify it.