IO::Pager::Page(3pm)

πŸ“¦
version 2.10 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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::Page
  • IO::Pager
  • IO::Pager::Unbuffered
  • IO::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 (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