class Foo { has $.x; # Explicitly generate an accessor: method x() is rw { return new Proxy: FETCH => {...}, STORE => {...}; } } class Foo::Bar isa Foo { method do_sth { ...; my $var = $.x; # Although used as an variable, the *method* Foo.x is called. # Foo::Bar does *not* directly access the variable. } }