for my $var ( qw( Driver Prefix Trace Debug Confess Caller Priorities Tags DATUM ) ) { no strict 'refs'; *{$var}= \${"Log::Agent::$var"}; } *prio_cache= \%Log::Agent::prio_cache; #### # import _all_ that Log::Agent exports: use Log::Agent qw( /./ ); # Have us export the same stuff Log::Agent does: sub import { my( $selfPkg )= shift( @_ ); local( $Exporter::ExportLevel )= 1 + $Exporter::ExportLevel; Log::Agent->import( @_ ); } # For each routine we redefine, unimport the function # before we redefine it in order to avoid a warning: BEGIN { undef &logcarp; } sub logcarp { # preprocess stuff Log::Agent::logcarp( @_ ); # postprocess stuff }