in reply to (tye)Re: Automatic Debugging
in thread Automatic Debugging

That's clever. I suppose a quick and dirty way would be to define ChildModule of Module and only define an ChildModule::Autoload. ChildModule::Autoload would log the function call, then call SUPER::ModuleSub

Replies are listed 'Best First'.
(tye)Re2: Automatic Debugging
by tye (Sage) on May 30, 2001 at 03:42 UTC

    Sorry, no. SUPER:: requires @ChildModule::ISA contain your Module, which also means that AUTOLOAD won't be called for methods that are defined in your Module.

    But you can do something like:

    package AutoTrace; my %pkgMap; sub AUTOLOAD { logCall( $AUTOLOAD, @_ ); my $wantPkg= $AUTOLOAD =~ s/(.*):://; $AUTOLOAD= $pkgMap{$wantPkg}."::".$AUTOLOAD; goto &$AUTOLOAD; } $pkgMap{ChildModule}= "Module"; *ChildModule::AUTOLOAD= \&AUTOLOAD;
    instead of the SUPER:: trick (again, can won't work, which often won't be a problem).

            - tye (but my friends call me "Tye")