IO::Pa...uffered(3pm)
π IO::Pager::Unbuffered β bestie edition π
okay so. this is IO::Pager::Unbuffered, one of the IO::Pager family, from the User Contributed Perl Documentation crew. short version: it pipes your output to whatever's in PAGER when β and only when β your destination is a TTY. no cap. π«Ά
β¨ NAME β¨
IO::Pager::Unbuffered β literally just: pipe output to PAGER if the destination is a TTY. that's the whole vibe. π
πΈ SYNOPSIS πΈ
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;
}
three whole ways to live your life, bestie. glob, scalar filehandle, or full-on object moment. main character energy, honestly. β¨
π¦ DESCRIPTION π¦
so here's the tea. the IO::Pager subclasses exist to programmatically decide whether or not to pipe a filehandle's output to a program specified in PAGER. and that PAGER value? it gets determined and set by IO::Pager at runtime, if it's not defined already. iykyk. π
for the actual method deets, go read IO::Pager. this page is not the one carrying that weight. π
π METHODS π
every single method here is inherited from IO::Pager β except for instantiation. that's it, that's the section. one little exception, iconic behaviour. π
π CAVEATS π
bestie. listen. you probably want to do something with SIGPIPE. like. actually. for real. do not skip this one. π
eg;
eval {
local $SIG{PIPE} = sub { die };
local $STDOUT = IO::Pager::open(*STDOUT);
while (1) {
# Do something
}
}
# Do something else
see how it's wrapped in the eval? that's the point. die gracefully, then go do something else. self-care. π§
π₯ SEE ALSO π₯
IO::PagerIO::Pager::BufferedIO::Pager::Page
(the whole friend group. go say hi. π)
π AUTHOR π
- Jerrad Pierce
<jpierce@cpan.org> - Florent Angly
<florent.angly@gmail.com>
this module was inspired by Monte Mitzelfelt's IO::Page 0.02 π
and significant proddage was provided by Tye McQueen. (proddage. we love a support system.) π«Ά
β COPYRIGHT AND LICENSE β
Copyright (C) 2003-2018 Jerrad Pierce
- 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.
and that's the page!! π this little slice of documentation came to you via perl v5.30.3, dated 2020-11-07, under the User Contributed Perl Documentation umbrella. slay, go forth, and page your output responsibly. periodt. π
β¨π
π¦ 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