AUTOLOAD The accessor for bar is going to look the same. For two attributes, the typing is not bad, but for 20 it is going to start to get tedious. You can define a subroutine AUTOLOAD in your class that Perl will call for you when it cannot find a subroutine of the given name: our $AUTOLOAD; # A package global set up by Perl. sub AUTOLOAD : lvalue { my ($self) = @_; my ($method) = $AUTOLOAD = /::([^:]+)$/; $self->{$method}; }