http://www.perlmonks.org?node_id=1003110


in reply to Re^4: Moo and Spreadsheet::ParseExcel
in thread Moo and Spreadsheet::ParseExcel

Error reproduced! :-)

Here's a one line patch for Moo::Role that fixes your issue. I'll report it to the Moo bug tracker when I've figured out why this patch makes any difference to anything!

# Replace this sub... sub apply_roles_to_package { my ($me, $to, @roles) = @_; $me->_inhale_if_moose($_) for @roles; $me->SUPER::apply_roles_to_package($to, @roles); } # With this instead... sub apply_roles_to_package { my ($me, $to, @roles) = @_; for my $r (@roles) { $me->_inhale_if_moose($r) }; $me->SUPER::apply_roles_to_package($to, @roles); }

Update: OK, it happens because something inadvertently causes the global $_ to become undefined.

Update 2: Bug report submitted.

Update 3: patched on git.

Update 4 (about a week later): Moo 1.000006 released.

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