Skip Menu |

This queue is for tickets about the Moops CPAN distribution.

Report information
The Basics
Id: 101290
Status: open
Priority: 0/
Queue: Moops

People
Owner: Nobody in particular
Requestors: IVANWILLS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.034
Fixed in: (no value)



Subject: Imports don't seem to work as described
Hi, The imports option to use Moops doesn't appear to import the methods supplied correctly (missing prototypes?). The files attached show the issue using imports and how I expect with "use". Ivan
Subject: moops-no-import.pl
#!/usr/bin/perl use Moops; class MyMoops { use List::Util qw/reduce/; sub test_me { my @ints = @_; return reduce { $a * $b } @ints; } } say $Moops::VERSION; say MyMoops->new->test_me(qw/1 2 3 4 5/);
Subject: moops.pl
#!/usr/bin/perl use Moops imports => { 'List::Util' => qw/reduce/ }; class MyMoops { sub test_me { my @ints = @_; return reduce { $a * $b } @ints; } } say $Moops::VERSION; say MyMoops->new->test_me(qw/1 2 3 4 5/);
Hi, 'imports' takes an array ref: use Moops imports => [ 'List::Util' => qw/reduce/ ]; https://metacpan.org/pod/Moops#Custom-Sugar /Erik On Sun Jan 04 15:21:09 2015, IVANWILLS wrote: Show quoted text
> Hi, > > The imports option to use Moops doesn't appear to import the methods > supplied correctly (missing prototypes?). > > The files attached show the issue using imports and how I expect with > "use". > > Ivan