☞ | Help! Help! | 8 |
sub AUTOLOAD { … my @stack = ($bottom_class); while (@stack) { my $class = pop @stack; next if $class eq __PACKAGE__;
__PACKAGE__ is a compile-time constant for Help itself
my $isa_var = $class . "::ISA"; push @stack, @{$isa_var};
my $symbol_table = $class . "::"; for my $name (keys %{$symbol_table}) { my $func_name = $class . "::" . $name; next unless defined &{$func_name}; $known_method{$name} ||= $class; } }
%Horrible::Thing:: is the symbol table for the class
It maps names to “globs” (don't ask)
defined &{Horrible::Thing::fgsfds} asks if there is a function with that name
Why &? (don't ask)
… }
☞ | ☞ |