in reply to Suppressing desired warnings from output of Test::NoWarnings

I think your code doesn't work because it contains errors

I suggest adding:

use strict ; use warnings ;

I did a small test myself, see results below:

use strict ; use warnings ; use Test::More ; use Test::Warn; warning_like ( sub { warn "Hello"; }, qr /Hello/, 'Hello warning' ) ; done_testing() ; __END__ ok 1 - Hello warning 1..1