http://www.perlmonks.org?node_id=208441


in reply to Silencing warnings when testing

If you use Test::More, you can use the diag() function to print diagnostic or debugging information. Test::Harness will suppress it when running tests normally. You can run the test by hand or with the verbose flag and see them.

If you are using Test::More, you can also use Test::Exception and Test::Warning to test for death and warnings. I've had good results with them.