Re: Define a error handler for a module
by Jenda Krynicky other posts by this author
Jan 9 2008 4:17AM messages near this date
Define a error handler for a module
|
Re: Define a error handler for a module
From: Torsten.Werner@[...].com
> Hi all,
> I'm looking in the documentation, but I can't find a way to set a parameter
> for a module during 'use {module} ...'.
>
> I've a special error handler in a module 'module_a'. In a other module
> 'module_b' I have a default error handler. I would like overwrite the error
> handler of 'module_b' by the error handler of 'module_a' if 'module_b' is
> used by 'module_a'. In any other case I would like leave the handler of
> 'module_b' untouched.
>
> 'module_b' has a few helper functions, it does not define a class. Any
> error handler has exactly the same definition (sub onError($$$);)
>
> Which possibilities do I have?
> Thanks a lot
> Torsten Werner
I don't see how it relates to PDK.
I think what you want is something like
package module_a;
use module_b;
...
sub module_b::onError {
...
}
...
That is as soon as you load module_a it will overwrite module_b's
subroutine onError.
Did I understand you right?
Jenda
===== Jenda@[...].cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
_______________________________________________
PDK mailing list
PDK@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Torsten Werner
Jenda Krynicky
Torsten Werner
|