Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Moo and Spreadsheet::ParseExcel

by karlgoethebier (Curate)
on Nov 08, 2012 at 17:39 UTC ( #1002952=perlquestion: print w/ replies, xml ) Need Help??
karlgoethebier has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, this code...

package MyParseExcel; use Spreadsheet::ParseExcel; use Moo::Role; use MooX::Types::MooseLike::Base qw(InstanceOf Str); 1;

...leads to:

Use of uninitialized value $roles[0] in sort at C:/Perl/site/lib/Role/Tiny.pm line 199. Compilation failed in require at C:\path\run.pl line 6.

But this one...

package MyParseExcel; # use Spreadsheet::ParseExcel; use Moo::Role; use MooX::Types::MooseLike::Base qw(InstanceOf Str); 1;

...works. In Role::Tiny i see...

sub _composite_info_for { my ($me, @roles) = @_; $COMPOSITE_INFO{join('|', sort @roles)} ||= do { # <-- 199 _load_module($_) for @roles; my %methods; foreach my $role (@roles) { my $this_methods = $me->_concrete_methods_of($role); $methods{$_}{$this_methods->{$_}} = $role for keys %$this_methods +; } delete $methods{$_} for grep keys(%{$methods{$_}}) == 1, keys %meth +ods; +{ conflicts => \%methods } }; }

Perhaps i found another module that can't with Moo? This was my doubt using Moo: Long time used modules don't work as expected. Hope i don't miss something.

Thank you for your patience and help.

Regards, Karl

Comment on Moo and Spreadsheet::ParseExcel
Select or Download Code
Re: Moo and Spreadsheet::ParseExcel
by tobyink (Abbot) on Nov 08, 2012 at 22:17 UTC

    I'm not able to reproduce that error message. Are you using the latest versions of all three modules? You could try re-ordering the use statements, perhaps putting Moo::Role first.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
      Spreadsheet::ParseExcel 0.59 Moo 1.000005 MooX::Types::MooseLike::Base 0.16

      All up to date. Re-ordering the use statements brought no success. I've tried this already. I don't have any idea for the moment.

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

        What's in run.pl??

        perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

      The only plan i have at the moment is: Not using roles and rewrite the stuff.

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1002952]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-10-26 05:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (151 votes), past polls