PrintControl(3pm)

πŸ’… PrintControl(3pm) β€” the manual page, but make it a vibe

okay so bestie, welcome to PrintControl(3pm) πŸ’– it lives in the User Contributed Perl Documentation corner of the perl universe, and honestly? it's a tiny plugin with one job and it does it flawlessly. no cap.

✨ NAME ✨

PDL::Perldl2::Plugin::PrintControl β€” disable default print output 🫢


🌸 SYNOPSIS 🌸

pdl> $x = 3;
3
pdl> $_REPL->load_plugin('PDL::Perldl2::Plugin::PrintControl');

pdl> $x;

pdl> $_REPL->print_by_default(1);
1
pdl> $x;
3

like, watch the silence after the plugin loads. that blank line? that's the whole point. icon behavior, truly. πŸ’€βœ¨


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea. by default, Devel::REPL always prints the results of its evaluation. and for small objects? adorable. perfect. no notes.

but for things like large data objects β€” think a 100x100 matrix in PDL β€” the result can be hundreds of lines of output for each command. hundreds. bestie. your terminal is not okay. 😭

this plugin disables the default print output and adds an attribute with accessor method print_by_default which you can use to toggle the print default on or off. main character toggle energy. πŸ‘‘


πŸ’… METHODS πŸ’…

by default, the PrintControl plugin sets print_by_default to 0 (false), which disables automatic printing of results. lowkey genius.

call the print_by_default accessor with a 1 (a true value) to enable default printing. that's it. that's the method. πŸŽ€

πŸ’– do_print

this is a convenience accessor for the print_by_default attribute.

  • if you call this method without a value, it toggles the current setting. surprise! ✨
  • otherwise, it just sets print_by_default to the value.

it is also available in the pdl2 shell as the do_print sub with the same operation, but with an implicit use of $_REPL. iykyk. 🧚


πŸ”₯ SEE ALSO πŸ”₯

  • "Devel::REPL"

πŸ‘‘ AUTHOR πŸ‘‘

Chris Marshall, "<chm at cpan dot org>" πŸ’Œ


Copyright (C) 2010 by Christopher Marshall

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


fr fr, that's the whole page. every flag, every method, every vibe. you're welcome. 🌸

and that's a wrap, bestie β€” this was perl v5.38.2, dated 2024-04-10, and you just finished reading PrintControl(3pm). slay. πŸ’œπŸŒˆ

πŸ“¦ where this page comes from