BEGIN { my @accessors = qw(one two foo); foreach my $methname (@accessors) { no strict 'refs'; *$methname = sub { # accessor sub }; } }