This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In test.pl, refactor the implementation of warning_{is,like} and warnings_like.
Break out the code to capture warnings from the code to analyse them. Implement
tests directly in warning_{is,like}, rather than implementing them as a call to
warning_like. Remove the C<use warnings "all">, as it is lexically scoped, and
won't apply to the scope of the subroutine being called.
Previously all 3 would erroneously pass if the expectation was for 1 warning,
there were more than 1 warnings, but the first warning matched the expected
warning.