[ic] RE: GlobalSub Overriding not seen in Authorizenet

Alexandra Birch interchange-users@icdevgroup.org
Thu Jun 13 09:31:01 2002


> I am trying to override the logDebug function by creating
> a GlobalSub which gets included in my interchange.cfg.
> This works when I call Debug from my html pages and
> the usertags. However from the Authorizenet and the 
> UserDB modules for example, the old logDebug function
> still gets used.
> 
> How can I use my new logDebug in Authorizenet.pm
> without editing directly the Util.pm module?

You can overide any function, which will be seen by both
inside safe, the usertags and the interchange library functions
by including a new library module at the end of interchange.cfg:

Module require Vend::Mynewpackage

Then in lib/Vend/Mynewpackage.pm:

package Vend::Util;
sub logDebug
{
   print "Llamando a logDebug overrideado\n";
}

package main;
*logDebug = \&Vend::Util::logDebug;
1;