Subject: | Moose error when loading Net::Google::Spreadsheets |
%>perl -MNet::Google::Spreadsheets -e 1
Attribute (service) of class Net::Google::Spreadsheets has no associated
methods (did you mean to provide an "is" argument?)
at C:/Perl/site/lib/Moose/Meta/Attribute.pm line 565
Moose::Meta::Attribute::_check_associated_methods('Moose::Meta::Attribut
e=HASH(0x25b9bc4)') called at C:/Perl/site/lib/Moose/Meta/Class.pm line 253
Moose::Meta::Class::add_attribute('Moose::Meta::Class=HASH(0x1fbd92c)',
'service', 'default', 'CODE(0x25a89a0)', 'definition_context',
'HASH(0x25b2950)'
) called at C:/Perl/site/lib/Moose.pm line 68
Moose::has('Net::Google::Spreadsheets', 'service', 'default',
'CODE(0x25a89a0)') called at C:/Perl/site/lib/Moose/Exporter.pm line 320
Moose::has('service', 'default', 'CODE(0x25a89a0)') called at
C:/Perl/site/lib/Net/Google/Spreadsheets.pm line 25
require Net/Google/Spreadsheets.pm called at -e line 0
main::BEGIN() called at
C:/Perl/site/lib/Net/Google/Spreadsheets.pm line 0
eval {...} called at C:/Perl/site/lib/Net/Google/Spreadsheets.pm
line 0
I happen to be using ActivePerl on Windows when producing this bug
report, but I get the same error reported from "regular" perl on my
Linux machines too.
Changing
has +service => (
default => sub {return $_[0]}
);
to
has +service => (
is => 'ro',
default => sub {return $_[0]}
);
in Net/Google/Spreadsheets.pm seems to fix the problem, although I don't
speak Moose well enough to know if that's actually a safe or proper change.