Skip to content

Instantly share code, notes, and snippets.

@awwaiid
Created December 31, 2015 03:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awwaiid/01fe0e56e2c1220548a1 to your computer and use it in GitHub Desktop.
Save awwaiid/01fe0e56e2c1220548a1 to your computer and use it in GitHub Desktop.
$ ./universal-greetings.p6
Hello from the Perl Universe!!!
#!/usr/bin/env perl6
my @greeting;
{
use Inline::Ruby;
@greeting.push: EVAL('"Hello"', :lang<Ruby>);
}
{
use Inline::Python;
@greeting.push: EVAL('"from"', :lang<Python>).decode('latin-1');
}
{
use Inline::Lua;
@greeting.push: EVAL('return("the")', :lang<Lua>);
}
{
use Inline::Perl5;
@greeting.push: EVAL('"Perl"', :lang<Perl5>);
}
@greeting.push: "Universe!!!";
@greeting.join(' ').say;
# use Inline::Ruby;
# use Inline::Python;
# use Inline::Lua;
# use Inline::Perl5;
# (
# EVAL('"Hello"', :lang<Ruby>),
# EVAL('"from"', :lang<Python>).decode('latin-1'),
# EVAL('return("the")', :lang<Lua>),
# EVAL('"Perl"', :lang<Perl5>),
# "Universe!!!"
# ).join(' ').say;
# Error output:
#
# ===SORRY!=== Error while compiling /home/awwaiid/./universal-greetings.p6
# Cannot import symbol &EVAL from Inline::Python, only onlystar-protos can be merged
# at /home/awwaiid/./universal-greetings.p6:30
# ------> use Inline::Python⏏;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment