use v5.14; package Foo { use Moo; has foo1 => ( is => "rw", init_arg => "foo2", reader => "foo3", writer => "foo4", ); } # Create an object, setting the attribute... my $obj = Foo->new(foo2 => 40); # Increment the value... $obj->foo4( $obj->foo3 + 1 ); # Or cheat and access the hashref directly... $obj->{foo1}++; # Print the value of the attribute... say $obj->foo3;