in reply to Autoload versus auto-generating accessors
For simple variable access, I have been using something like ...
package ... ; BEGIN { for my $opt ( qw< l i s t > ) { # Normalize. my $sub = lc $opt; $sub =~ tr/-/_/; no strict 'refs'; *$sub = sub { # get|set a variable based on number # (and/or kind, value) of arguments passed. }; } }
... Moo|Moose may allow less text to type; provide more flexibility, validation, etc; haven't bothered yet.
As for not being able install new modules, you could copy the text of the modules which are written in pure Perl (don't need a C compiler). That won't help when the newer perl syntax is present, obviously.
|
---|