The following module was proposed for inclusion in the Module List:
modid: Class::Hook
DSLIP: bdpOp
description: Adds hooks to methods calls
userid: PDENIS (Pierre Denis)
chapterid: 6 (Data_Type_Utilities)
communities:
similar:
Hook::LexWrap Hook::WrapSub
rationale:
This module allows you to call your own subroutines (hooks) before
and after method calls to another class. The main advantages are: -
You don't have to change the class you're adding hooks - The calls
are intercepted dynamically - you don't need to predeclare your
calls nor the method you want to intercept...
Let's say you want to spy the calls to Foo.pm You want your subs
&sub1 and &sub2 to be called before and after every call to a
Foo->method. No problemo
When your code does Foo->method1($param); 1/ Class::Hook calls your
&sub1 before Foo->method1($param) with a lot of useful infos 2/
Class::Hook calls Foo->method($param) 3/ Class::Hool calls &sub2
with useful infos and the return values from Foo->method($param)
I plan to use Class::Hook to create a WSDL::Generator class which
will intercept dynamically all calls to SOAP service to generate a
WSDL file on the fly.
It works only for method calls on other classes, so I suggest
Class::Hook rather than Hook::Class or Hook::Something
Thank you Pierre Denis
enteredby: PDENIS (Pierre Denis)
enteredon: Tue Nov 27 17:15:35 2001 GMT
The resulting entry would be:
Class::
::Hook bdpOp Adds hooks to methods calls PDENIS
Thanks for registering,
The Pause Team
PS: The following links are only valid for module list maintainers:
Registration form with editing capabilities:
https://pause.perl.org/pause/authenquery?ACTION=add_mod&USERID=b4200000_129fef0c417c63f1&SUBMIT_pause99_add_mod_preview=1
Immediate (one click) registration:
https://pause.perl.org/pause/authenquery?ACTION=add_mod&USERID=b4200000_129fef0c417c63f1&SUBMIT_pause99_add_mod_insertit=1