Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic variable @*INC not found

Tags:

electron

raku

So I've been trying to get electron working with Perl6 and looks like after all my efforts of hacking things to get them to work, it just doesn't want to do it's thing. I have used the following script (one of the examples from the electron repo on git):

#!/usr/bin/env perl6

use v6;

use Electron;

my $app = Electron::App.instance;
LEAVE {
  $app.destroy if $app.defined;
}

say Electron::Dialog.show-open-dialog.perl;

say Electron::Dialog.show-save-dialog.perl;

say Electron::Dialog.show-message-box.perl;

Electron::Dialog.show-error-box("Text", "Content");

prompt("Press any key to exit");

On Running I get this error:

Dynamic variable @*INC not found
  in submethod initialize at C:\rakudo\share\perl6\site\sources\42D84B59BC3C5A414EA59CC2E3BC466BBAF78CDA line 54
  in method instance at C:\rakudo\share\perl6\site\sources\42D84B59BC3C5A414EA59CC2E3BC466BBAF78CDA line 33
  in block <unit> at test.p6 line 9

Actually thrown at:
  in method throw at C:\rakudo/share/perl6/runtime/CORE.setting.moarvm line 1
  in block  at C:\rakudo\share\perl6\site\sources\42D84B59BC3C5A414EA59CC2E3BC466BBAF78CDA line 55
  in submethod initialize at C:\rakudo\share\perl6\site\sources\42D84B59BC3C5A414EA59CC2E3BC466BBAF78CDA line 48
  in method instance at C:\rakudo\share\perl6\site\sources\42D84B59BC3C5A414EA59CC2E3BC466BBAF78CDA line 33
  in block <unit> at test.p6 line 9

And after looking at the submethod i noticed that this was part of the electron module for perl6 and it seems to not like the use of @*INC within the module.

Has anyone managed to successfully use the electron module with Perl6? Has anyone else come across this error? Is there an easy way around it?

I can probably modify the module to get it to compile and run but I wouldn't know where to start with replacing the @*INC.

like image 914
Phyreprooph Avatar asked Feb 12 '16 00:02

Phyreprooph


1 Answers

$*REPO is the 6.c replacement for @INC in Perl 5

In Perl 5 the @INC variable is a global array of paths to be searched when Perl is looking for modules (analogous to the PATH variable used by many OSes to contain the paths to be searched when that OS is looking for programs).

Until recently Perl 6 had a corresponding @*INC variable.

Having an array for this turned out to be inappropriate for 6.c given concurrent module loading and advanced module selection features introduced by the Perl 6 module repository mechanism.

About a month or two before 6.c a lead dev (Stefan Seifert aka nine) switched module loading to use a chained repo approach via a new $*REPO scalar and obsoleted the include array.

For various reasons they did this without a deprecation period.

Any pre 6.c modules that directly mention @*INC need an update and some haven't yet gotten that update. The Electron module was one such -- until you filed an issue (thanks!) and the module's author responded by fixing it.

I'm not aware of any "official" design or enduser documentation of $*REPO. The best info is probably to be found by asking user nine on the freenode IRC channel #perl6-toolchain (logs; join).

like image 163
raiph Avatar answered Oct 19 '22 05:10

raiph