$cat test_nomoose.pl package NumberRun; sub new { my $class = shift; my %args = @_; my %h = ( x => 0, y => 0); @h{ keys %args} = values %args; return bless \%h; } sub x { my $self = shift; $self->{x} = shift if @_; $self->{x}; } sub y { my $self = shift; $self->{y} = shift if @_; $self->{y}; } 1; package Main; use strict; use warnings; my $z = NumberRun->new(x => 1, y => 2); print "z's x and y = ", $z->x()," ", $z->y(), "\n"; $time perl test_nomoose.pl z's x and y = 1 2 real 0m0.07s user 0m0.01s sys 0m0.01s