#!/usr/bin/perl use Modern::Perl; { package Foo; use Moose; has bar => ( is => 'ro', writer => '_set_bar', ); } my $foo = Foo->new; $foo->bar('something'); # outputs: # Cannot assign a value to a read-only accessor at # /home/brunov/tmp/pm.pl line 16 $foo->_set_bar('something'); say $foo->bar; # outputs: # something