in reply to Re: Safer monkey-patching
in thread Safer monkey-patching
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__; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Safer monkey-patching
by JavaFan (Canon) on Jan 19, 2012 at 10:58 UTC |
In Section
Meditations