Daily Shaarli

All links of one day in a single page.

February 3, 2022

How can I prevent Perl Moose Read-Only Attributes being set upon a call to new? - Stack Overflow
thumbnail

Use the init_arg attribute configuration (see "Constructor parameters" in Moose::Manual::Attributes):

package SOD::KuuAnalyze::ProdId;
use Moose;

has 'users' => (
    isa => 'ArrayRef[Str]', is => "ro",
    init_arg => undef,    # do not allow in constructor
);
1;