Created
September 1, 2010 05:09
-
-
Save ashgti/560253 to your computer and use it in GitHub Desktop.
This file contains 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
Done starting | |
Perl6 Interp ready | |
> say 2 | |
2 | |
> 1 + 3 + 4 | |
8 | |
> | |
done |
This file contains 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
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