package MyClass; use Moo; has some_attr => ( is => 'ro' ); sub some_func { uc(shift->some_attr) } # eg 1;