Put wrapper around a subroutine
use Hook::LexWrap;
sub real_func {
say "real_func called";
}
wrap 'real_func',
pre => sub {say 'being called';},
post => sub {say 'done being called'};
&real_func;
Put wrapper around a subroutine
use Hook::LexWrap;
sub real_func {
say "real_func called";
}
wrap 'real_func',
pre => sub {say 'being called';},
post => sub {say 'done being called'};
&real_func;