Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created September 1, 2010 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashgti/560253 to your computer and use it in GitHub Desktop.
Save ashgti/560253 to your computer and use it in GitHub Desktop.
Done starting
Perl6 Interp ready
> say 2
2
> 1 + 3 + 4
8
>
done
use IPC::Run qw(start harness pump start timeout);
my ($in, $out);
my $p = start ['/Users/john/Projects/rakudo/perl6'], '>', \$out, '<', \$in, timeout(35);
print "Done starting\n\n";
print "Perl6 Interp ready\n\n";
$in = "say 2\n";
$p->pump while length $in;
$p->pump until $out =~ /\n>\s/m;
print $out;
$out = "";
$in = "1 + 3 + 4\n";
$p->finish;
print $out;
print "\ndone\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment