IO::Pager::Unbuffered(3pm)

IO::Pager::Unbuffered3pm

Pipe output to pager if destination is a tty

Usage

  use IO::Pager::Unbuffered;
  {
    local $STDOUT = IO::Pager::Unbuffered::open *STDOUT;
    print <<"  HEREDOC" ;
    ...
    A bunch of text later
    HEREDOC
  }
  {
    # You can also use scalar filehandles...
    my $token = IO::Pager::Unbuffered::open($FH) or warn($!);
    print $FH "No globs or barewords for us thanks!\n" while 1;
  }
  {
    # ...or an object interface
    my $token = new IO::Pager::Unbuffered;
    $token->print("OO shiny...\n") while 1;
  }

Overview

IO::Pager subclasses are designed to programmatically decide whether or not to pipe a filehandle's output to a program specified in PAGER; determined and set by IO::Pager at runtime if not yet defined.

See IO::Pager for method details.

Methods

All methods are inherited from IO::Pager; except for instantiation.

Caveats

You probably want to do something with SIGPIPE eg;

  eval {
    local $SIG{PIPE} = sub { die };
    local $STDOUT = IO::Pager::open(*STDOUT);
    while (1) {
      # Do something
    }
  }
  # Do something else

Releases

7 releases since Debian 8 (Jessie); the text changed 4 times.

  1. 8
  2. 9
  3. 10
  4. 11–13
  5. Arch

Author

Jerrad Pierce <[email protected]>

Florent Angly <[email protected]>

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

Significant proddage provided by Tye McQueen.

From perl-io-pager 2.10-6 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.