Next Tricks of the Wizards 116

NEXT.pm

        sub AUTOLOAD {
          my ($self_class) = ref $_[0] || $_[0];
          my $cs = class_structure($self_class);
          my $caller_class = caller;
          my $next_class = $caller_class;
          my ($my_class, $method) = 
                ($NEXT::AUTOLOAD =~ /(.*)::(.*)/);
          do {
            $next_class = $cs->{$next_class};
          } while defined $next_class 
               && not defined &{"$next_class\::$method"} ;
          if (defined $next_class) {
            goto &{"$next_class\::$method"};
          } else {
            croak qq{Can't locate object method "$meth" 
                          via package "$self_class"};
              if $my_class eq 'NEXT::ACTUAL';
            return;        
          }
        }
        @NEXT::ACTUAL::ISA = ('NEXT');


Next Copyright © 2003 M. J. Dominus