in reply to Controlling the start and endings of method calls
The documentation for Hook::WrapSub has some suggestions that apply directly to your requirements:
use Hook::WrapSub qw( wrap_subs ); wrap_subs \&before, 'some_func', 'another_func', \&after; sub before { croak "No arguments allowed!" if @_; # but if you're wrapping object methods, you might want to take # the object reference (i.e. $self) into account: # croak "No arguments allowed" if @_ > 1; } sub after { print "Always the same <html>..."; } # your subs follow
|
|---|