If it's a class, I would consider both the symbol table and the AUTOLOAD ways good; although AUTOLOAD is safer in the respect that it won't override any existing methods.
Personally, I'd just install the methods straight into the symbol table as it feels clean and should be slightly more performant. And safety -- you can avoid overwriting any subroutines at install time:
warn "baz already defined" if defined *{__PACKAGE__ . "::baz" };
In reply to Re^3: a loop for creating subroutines?
by Anonymous Monk
in thread a loop for creating subroutines?
by mascip
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |