Redefining a function only produces a warning if "use warnings" is in effect. So classic monkey patching will not necessarily produce compile-time warnings.
If a conflict warning is desired, that's fairly easy to add in with my method...
BEGIN { require Example::Error; foreach my $method (qw/asplode/) { warn "Example::Error->$method already defined." if Example::Error->can($method); } push @Example::Error::ISA, __PACKAGE__; }
In reply to Re^2: Safer monkey-patching
by tobyink
in thread Safer monkey-patching
by tobyink
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |