# New Ticket Created by  Steve Schulze 
# Please include the string:  [perl #126974]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=126974 >


If I build constant arrays, use those arrays to built _other_ constant 
arrays
with meta operators and then try to access those arrays from a pre compiled
module, I get an error: "Cannot invoke this object"

It doesn't seem to happen if the arrays are declared "my" array,
It doesn't seem to happen if I don't use Meta operators to build the arrays.
It doesn't seem to happen when run in the same file, only when pre-compiled
and loaded as a module.

May be an example of DIHWIDT, but I spent several hours tracking
down errors that only occurred when code got packaged as a module
and pre-compiled.

See: https://github.com/thundergnat/Lingua-EN-Numbers-Cardinal
for larger example.

Demo files attached: Bogus.pm6 and bogus.p6
use lib '.';
use Bogus;
say broken(2);
use v6;

unit module Bogus;

constant @d = < a b c d e >;
constant @e = @d X~ ' test';
constant @f = @d »~» ' test';


sub broken ($a) is export {
    say @f[$a];
    say @e[$a];
}

#broken(2);

Reply via email to