How do I capture Perl’s STDOUT in a variable?

The new, cool way to handle this is with Capture::Tiny. You can use it surgically to affect just the part of the program where you need it without disturbing anything else. But, I’d probably do what cjm recommends since that doesn’t require a module.

Leave a Comment