Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example in the documentation does not work - Undefined subroutine &main::print called #181

Open
oldcoder47 opened this issue Dec 21, 2022 · 1 comment

Comments

@oldcoder47
Copy link

Verbatim from your documentation:
use Inline::Perl5;

my $p5 = Inline::Perl5.new;

$p5.call('print', 'Hello World');

results in:
Undefined subroutine &main::print called.

in method handle_p5_exception at /.rakubrew/versions/moar-2022.12/share/perl6/site/sources/FE0EA2E16CD0CD31716830FEE610E9B4116A2281 (Inline::Perl5) line 345
in method call at /.rakubrew/versions/moar-2022.12/share/perl6/site/sources/FE0EA2E16CD0CD31716830FEE610E9B4116A2281 (Inline::Perl5) line 431
in block at P5Test.raku line 5

I am running on Windows 11 WSL2 Ubuntu 20.04 where I used rakubrew to get raku and raku -v shows
Built on MoarVM version 2022.12.

@niner
Copy link
Owner

niner commented Dec 27, 2022

Indeed, that's a bug in the documentation. The example would work with any other function. More precicely: with any function, as print actually is not one, but instead is a keyword. That's why EVAL 'print "hello world"', :lang<Perl5> works fine, but the low level version doesn't. Will replace the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants