Use another language to call a function: Difference between revisions

m
→‎{{header|Raku}}: Fix code: Perl 6 --> Raku
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (→‎{{header|Raku}}: Fix code: Perl 6 --> Raku)
Line 1,356:
This [https://stackoverflow.com/a/50771971/3386748 SO answer], by JJ Merelo, explained the difficulty on providing a simple solution.  So this attempt takes the same approach as PicoLisp by summoning the interpreter at run time.
{{trans|PicoLisp}}
query.p6raku
<lang perl6>#!/usr/bin/env perl6raku
 
sub MAIN (Int :l(:len(:$length))) {
Line 1,372:
char buf[64];
 
sprintf(buf, "/home/user/query.p6raku --len=%zu", *Length);
if (!(fp = popen(buf, "r")))
return 0;
2,392

edits