package Bro::Doug ; use strict ; use warnings ; use warnings::register ; BEGIN{ no strict 'subs' ; my @ACCESSOR_METHODS = qw( one two three ) ; foreach my $i ( @ACCESSOR_METHODS ){ sub $i { my $self = shift ; if ( @_ ) { $self->{ uc $i } = shift @_ } return $self->{ uc $i } ; } } } sub new { my $class = shift ; my $self = {} ; bless ($self, $class) ; return $self ; } 1; #### % perl -cw Doug.pm > Illegal declaration of anonymous subroutine at Doug.pm line 58.