## only generate explicitly listed subs: BEGIN { no strict 'refs'; my @fields = qw/ name age favorite_color ... /; for my $f (@fields) { *$f = sub { ## argument, error checking, etc return $_[0]->{$f}; }; } } ## instead of sub AUTOLOAD { (my $func = $AUTOLOAD) =~ s/.*::/; ## argument, error checking, etc.. ## is $func a valid method?? return $_[0]->{$func}; }