Next | Hook::LexWrap | 3 |
One typical example would be tracing:
use Hook::LexWrap; wrap 'myfunction', pre => sub { warn "About to call myfunction(@_)\n" };
myfunction(...);
Or function-call profiling:
my $COUNT; wrap 'myfunction', pre => sub { $COUNT++ };
...
END { warn "myfunction() called $COUNT times.\n" }
Next | Copyright © 2003 M. J. Dominus |