How can I unit test Perl functions that print to the screen?

Viewed 4437

I'm trying to use Test::More to unit test Perl functions that print to the screen.

I understand that this output may interfere with tools such as prove.

How can I capture this output so I can print it with diag(), and also run tests on the output itself?

3 Answers
Related