# Somewhere inside the object's package sub get_set :lvalue { my ($self, $key) = @_; $self->{ $key }; } # Your code that uses it my $obj = Some::Object->new(); $obj->get_set( 'name' ) = 'Limbic'; print "Hello, ", $obj->get_set( 'name' ), "\n";