Created
December 31, 2015 03:16
-
-
Save awwaiid/01fe0e56e2c1220548a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./universal-greetings.p6 | |
Hello from the Perl Universe!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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