Hi Tom, If you put the attribute is export on a sub, then it is part of the :DEFAULT and :ALL tagsets. That means you can import them by:
use Bar :DEFAULT; http://design.perl6.org/S11.html#Dynamic_exportation states: The default EXPORTALL handles symbol exports by removing recognized export items and tagsets from the argument list, *then calls the **EXPORT subroutine in that package (if there is one), passing in the remaining arguments.* The bold text is my emphasis. It seems to imply that in perl6 you can only import by tagsets without implementing an EXPORT subroutine. This strikes me as weird because of this example in S11: use Sense <common @horse>; but I couldn't find any examples in the spec tests. Am I missing something? -Nate On Fri, Mar 27, 2015 at 6:37 PM, Tom Browder <tom.brow...@gmail.com> wrote: > I'm trying to get the basic syntax down on creating and using a > module. I've tried this and get an error: > > # file 1: Bar.pm > module Bar; > sub foo($a, $b, $c) is export {} > > # file 2: doit.pl > v6; > use lib <.>; > use Bar <foo>; > my @t = foo(1, 2, 3); > > # in a shell > $ perl6 doit.pl > ===SORRY!=== > Error while importing from 'Bar': no EXPORT sub, but you provided > positional argument in the 'use' statement > > I've tried to digest the S11 synopsis on compilation units and I don't > see any obvious problem. > > Ideas, please. > > Thanks. > > Best regards, > > -Tom >