> On 04 Jan 2015, at 14:47, Carl Mäsak (via RT) <[email protected]> 
> wrote:
> 
> # New Ticket Created by  "Carl Mäsak" 
> # Please include the string:  [perl #123541]
> # in the subject line of all future correspondence about this issue. 
> # <URL: https://rt.perl.org/Ticket/Display.html?id=123541 >
> 
> 
> $ perl6 -v
> This is perl6 version 2014.12-86-g43b724e built on MoarVM version 2014.12
> 
> $ cat M.pm
> use v6;
> use DBIish;
> 
> module M {
>    INIT {  # A
>        DBIish.connect("SQLite", :database<db>, :RaiseError);  # B
>    }  # A
> 
>    our sub x() is export {
>        say "OH HAI";
>    }
> }
> 
> $ perl6 -I. -e'use M; x()'
> ===SORRY!=== Error while compiling -e
> Undeclared routine:
>    x used at line 1
> 
> ...
> 
> This is not what I expected. I expected it to print "OH HAI".
> 
> Furthermore, remove the two lines marked "A", and it works as
> expected. Remove the line marked "B" and it works.
> 
> My best guess, for what it's worth, is that the method call in the
> INIT block is interfering with the normal exporting from the module.

use v6;
use Test;
module M {
    INIT {
        say <a b c>.Set;
    }

    our sub x is export { say "x" }
}

This works without any problem.

I would concur that it is not just any method call, but something specific to 
DBIish.connect;


Liz

Reply via email to