my $newbook = Lib::Book->new(
isbn => 'ISBN',
has isbn => (
is => 'rw',
My code, in which I can see no material differences from the documentation (http://search.cpan.org/~haarg/Moo-1.004002/lib/Moo.pm), crashes as follows:
Can't locate object method "isbn" via package "Lib::Book" at
Z:\Data\Library\Dancer2\sopw.pl line 9 (#1)
(F) You called a method correctly, and it correctly indicated a pa
functioning as a class, but that package doesn't define that parti
method, nor does any of its base classes. See perlobj.
Uncaught exception from user code:
Can't locate object method "isbn" via package "Lib::Book" at Z
+:\Data\Library\Dancer2\sopw.pl line 9.
I'm slightly surprised by the error message's reference to an "object method" when I'm trying to address a property, but I suspect that this is merely a Perl idiosyncracy. The assignment in the "new" command works - printing the object using Data::Dumper reveals the isbn property set as I would expect. I tried inserting the "namespace::clean" line from the docs, but that changed nothing.
What should I look at next, please?