Devel::SummarizedWarnings - Causes warnings to be summarized
use Devel::SummarizedWarnings; use warnings; for ( 0 .. 10 ) { $k = 0 + undef . $_; } $k = 1 + undef . $_; warn "Seagulls!\n";
produces the output
Warning: Use of "undef" without parens is ambiguous on lines 5 and 8 Use of uninitialized value in addition (+) on lines 5 (x11) and 8 Use of uninitialized value in concatenation (.) or string on line 8 Seagulls!
instead of
Warning: Use of "undef" without parens is ambiguous at w.pl line 5. Warning: Use of "undef" without parens is ambiguous at w.pl line 8. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 5. Use of uninitialized value in addition (+) at w.pl line 8. Use of uninitialized value in concatenation (.) or string at w.pl line 8. Seagulls!
This module traps all warnings and summarizes them when the your perl script exits. Warning trapping can be interrupted and resumed by removing/installing the Devel::SummarizedWarnings::append_to_warning_log handler into $SIG{'__WARN__'}.
Trapped warnings are stored in @Devel::SummarizedWarnings::LOGGED_WARNINGS.
Joshua b. Jore <jjore@cpan.org>
To install Devel::SummarizedWarnings, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::SummarizedWarnings
CPAN shell
perl -MCPAN -e shell install Devel::SummarizedWarnings
For more information on module installation, please visit the detailed CPAN module installation guide.