Skip to content
Snippets Groups Projects
Commit 4b03439f authored by Mark Harrison's avatar Mark Harrison
Browse files

Ignore subroutine redefined warnings when reloading modules

git-svn-id: https://labs.omniti.com/resmon/branches/resmon2@371 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
parent c8aa5e9f
No related branches found
No related tags found
No related merge requests found
......@@ -65,8 +65,15 @@ sub new {
my $mod_filename = "$current.pm";
$mod_filename =~ s/::/\//g;
delete $INC{$mod_filename};
eval "use $current;";
{
local($SIG{__WARN__}) = sub {
if($_[0] =~ /[Ss]ubroutine ([\w:]+) redefined/ ) {
return;
}
warn @_;
};
eval "use $current;";
}
if ($@) {
print STDERR "Problem loading monitor $current:\n";
print STDERR "$@\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment