count explicit Carps as compile warnings

This commit is contained in:
Graham Knop 2011-04-06 10:01:46 -05:00
parent 369ae7d4d4
commit c7bbb4e639

View file

@ -37,9 +37,10 @@ foreach my $library (@modules) {
local $SIG{__WARN__} = sub { local $SIG{__WARN__} = sub {
my $warn = shift; my $warn = shift;
# file the warning occurred in # file the warning occurred in
my $caller = caller;
my $warning_file = realpath( (caller(0))[1] ); my $warning_file = realpath( (caller(0))[1] );
# only care about it if it is within the WebGUI lib directory # only care about it if it is within the WebGUI lib directory or is an explicit warning
if ($warning_file =~ /^\Q$wgLib/) { if ($warning_file =~ /^\Q$wgLib/ || $caller eq 'Carp') {
$warnings .= $warn; $warnings .= $warn;
} }
}; };