NAME Module::Patch - Patch package with a set of patches VERSION
version 0.18 SYNOPSIS To use Module::Patch directly: # patching
DBI modules so that calls are logged use Module::Patch
qw(patch_package); use Log::Any '$log'; my $handle =
patch_package(['DBI', 'DBI::st', 'DBI::db'], [ {action=>'wrap',
mod_version=>':all', sub_name=>':public', code=>sub { my $ctx =
shift; $log->tracef("Entering %s(%s) ...", $ctx->{orig_name},
\@_); my $res; if (wantarray) { $res=[$ctx->{orig}->(@_)] } else
{ $res=$ctx->{orig}->(@_) } $log->tracef("Returned from %s",
$ctx->{orig_name}); if (wantarray) { return @$res } else {
return $res } }}, ]); # restore original undef $handle; To
create a patch module by subclassing Module::Patch: # in your
patch module package Some::Module::Patch::YourCategory; use
parent qw(Module::Patch); sub patch_data { return { v => 3,
patches => [...], # $patches_spec config => { # per-patch-module
config a => { default => 1, }, b => {}, c => { default => 3, },
}, }; } 1; # using your patch module use S