Is it possible to create an attribute that can only be set in the constructor in Moose? I’d like to do something like this:
my $foo = new Foo(file => 'foo.txt');
my $bar = new Foo(string => $str);
$foo->file('baz.txt'); # dies
I know I can create an attribute that can not be set in constructor, but the complementary case seems to be missing.