I open raku/rakudo/perl6 thus:
con@V:~/Scripts/perl6$ perl6
To exit type 'exit' or '^D'
>
Is the above environment called the "interpreter"? I have been searching forever, and I cannot find what it's called.
How can I execute a rakudo script like I would do
source('script.R')
in R, or exec(open('script.py').read())
in python3?
To clarify, I would like the functions and libraries in the script to be available in REPL, which run
doesn't seem to do.
I'm sure this exists in documentation somewhere but I can't find it :(
raku
followed by your script namemy_raku_script.p6
, therakudo
compiler/interpreter executes themy_raku_script.p6
for you. If at the Linux/Unix shell command line you typeraku
followed by a return, therakudo
compiler/interpreter opens a REPL for you.repl
function Liz added to Rakudo earlier this year would do the trick if you're willing to call it from within your script. But it's not mentioned in the Raku docs (which is fair enough if it's Rakudo specific, which I imagine it is), and I haven't found it elsewhere either (which is not so cool but might be my lack of search skills/patience), and nor have I managed to get it to work. Anyhow, maybe .@Liz will read this and provide an answer...