Next Tricks of the Wizards 114

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 (undef, $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 {
            return;
          }
        }


Next Copyright © 2003 M. J. Dominus