What other kind of code (besides string eval) can generate methods on the fly?AUTOLOAD is both a well known generator of methods/functions as a simulator. You might not find a Foo->bar() method while searching the stash, but that doesn't mean you can't call 'bar' on Foo. AUTOLOAD may handle that; sometimes by installing a Foo::bar and then calling it or by just taking care of itself.
As for other ways beside string eval to generate methods, there's the assignment to the typeglob:
or*{"Foo::bar"} = sub {print "Hello, world"};
The latter is what typically happens at import time.*{"Foo::bar"} = \&{"Baz::quux"};
In reply to Re: How to find all the available functions in a file or methods in a module?
by JavaFan
in thread How to find all the available functions in a file or methods in a module?
by szabgab
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |