As Daxim points out, private methods are prefixed with "_". Since attributes (instance variables) generate getters methods (and if rw also sets methods) out of the box, you should do this:
has 'myvariable' => ( is => 'ro', writer => '_myvariable', init_arg => undef,
This way you can set this attribute inside your class / instance and not set it externally. If the read access is too large, you can also mark it "private":
has '_myvariable' => ( is => 'ro', writer => '_set_myvariable' init_arg => undef,
nxadm source share