Test::...Captor(3pm)

✨ NAME ✨

Test::Valgrind::Action::Captor β€” a mock Test::Valgrind::Action whose whole personality is capturing output πŸ’…


🌸 VERSION 🌸

Version 1.19 bestie, we're on 1.19 πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this class is literally a little stash of helpers for saving, redirecting and restoring filehandles. That's it. That's the whole job. She's a stagehand, not the main character πŸŽ€

Real talk: it is NOT meant to be used directly as an action. Do not cast her in the lead role. She will not serve. πŸ™ˆ

πŸ’… METHODS πŸ’…

πŸŽ€ new

Just a croaking stub, fr fr 😭 β€” she exists purely to remind you not to use this class as a real action. She's not being rude, she's being clear. Boundaries, periodt.

πŸ“ save_fh

$tva->save_fh($from, $mode);
$tva->save_fh($from, $mode, $to);

Saves the original filehandle $from that was opened with mode $mode πŸ‘‘ and then redirects it β€” to $to if $to is defined, or to /dev/null otherwise πŸ•³οΈβœ¨

Like, if you don't tell her where to send it, she's sending it straight to the void. Iconic behaviour honestly.

🌈 restore_all_fh

$tva->restore_all_fh;

Puts every single filehandle that got saved via save_fh back to its original state 🫢 It's the un-doing. The putting-back. The "we were never here" of it all πŸ’€

Important detail: the redirections aren't closed. She restores, she does not clean up after you. That's your business, bestie.

⭐ SEE ALSO ⭐

  • Test::Valgrind
  • Test::Valgrind::Action
  • Capture::Tiny

πŸ‘‘ AUTHOR πŸ‘‘

Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.

You can contact him by mail πŸ“§ or on "irc.perl.org" (vincent) β€” iykyk, the IRC girlies know πŸ’œ


πŸ’€ BUGS πŸ’€

Found a bug? Have a feature request? Please report it to "bug-test-valgrind at rt.cpan.org", or slide through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Valgrind> πŸ›

He will be notified, and then you'll automatically be notified of progress on your bug as he makes changes. It's giving mutuals. It's giving updates. We love a feedback loop ✨


🧚 SUPPORT 🧚

You can find the documentation for this module with the perldoc command, bestie:

perldoc Test::Valgrind::Action::Captor

Go read it. Treat yourself. πŸ“–πŸŽ€


Copyright 2009,2010,2011,2013,2015,2016 Vincent Pit, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Slay, legally speaking 🫢


That's the whole page, babe β€” running on perl v5.40.1, dated 2025-04-13, and yes that footer is giving "User Contributed Perl Documentation" energy πŸ’… byeee πŸ‘‹πŸ’–

πŸ“¦ where this page comes from