IO::Pager::Page(3pm)
π IO::Pager::Page β¨
okay bestie, so this is IO::Pager::Page, a little gem from the User Contributed Perl Documentation corner of CPAN, and she is here to do exactly one thing and do it beautifully: pipe your STDOUT to a pager when STDOUT is a TTY. that's the whole vibe. π
π NAME π
IO::Pager::Page β literally just emulating IO::Page over here, no cap: pipe STDOUT to a pager if STDOUT is a TTY. that's her. that's the girl. π
π¦ SYNOPSIS π¦
Pipes STDOUT to a pager if STDOUT is a TTY. so simple. so iconic. πΈ
β¨ DESCRIPTION β¨
so IO::Pager was designed to programmatically decide whether or not to point the STDOUT file handle into a pipe to a program specified in the PAGER environment variable, or one of a standard list of pagers. that's the tea. π
like, she's out here doing vibe checks on your filehandles and then routing your text to the right pager. main character energy fr fr. π
π 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
okay so real talk about that BEGIN block: you want to load IO::Pager::Page first, before anything else gets a chance to send stuff to STDOUT. that's what the comment is telling you β use I::P::P first, just in case another module sends output to STDOUT. don't skip that, bestie, it's the whole point. π«Ά
now, if you wanna forgo the potential for a Broken Pipe foible resulting from the user exiting the pager prematurely β yeah, that's a real thing that can happen and it's giving π β then load IO::Pager::Page like so:
use IO::Pager::Page hush=>1;
look at her. hush=>1. quiet little icon. π€«β¨
π SEE ALSO π
IO::PageIO::PagerIO::Pager::UnbufferedIO::Pager::Buffered
the whole friend group. go say hi. π
π AUTHOR π
- Jerrad Pierce
<jpierce@cpan.org> - Florent Angly
<florent.angly@gmail.com>
This module inspired by Monte Mitzelfelt's IO::Page 0.02. shoutout to the originator, we love a legacy moment. π
π§ COPYRIGHT AND LICENSE π§
Copyright (C) 2003-2015 Jerrad Pierce
and now, the sacred texts, the commandments, the β¨rulesβ¨:
- Thou shalt not claim ownership of unmodified materials.
- Thou shalt not claim whole ownership of modified materials.
- Thou shalt grant the indemnity of the provider of materials.
- Thou shalt use and dispense freely without other restrictions.
Or, if you prefer:
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.0 or, at your option, any later version of Perl 5 you may have available.
ngl the "thou shalt" list is giving stone tablets but make it software licensing and honestly? slay. π
okay that's the whole page, bestie β and before you go, this beauty was built on perl v5.30.3 and dated 2020-11-07, so jot that down in your notes app. mwah, go pipe something pretty. ππ¦β¨
π¦ where this page comes from
- debian bookworm: libio-pager-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libio-pager-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libio-pager-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libio-pager-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libio-pager-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libio-pager-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms