Skip to content

Instantly share code, notes, and snippets.

@ugexe
Created July 5, 2015 06:12
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 ugexe/cf047b86bfb66ada37df to your computer and use it in GitHub Desktop.
Save ugexe/cf047b86bfb66ada37df to your computer and use it in GitHub Desktop.
$!promise = start {
my $p = run(
$*EXECUTABLE,
@!includes.map({ qqw/-I$_/ }),
$!file,
:out, :err, :cwd($!path)
);
repeat until $p.out.eof {
$!stdout.emit($p.out.getc);
if $p.?err && !$p.err.eof {
if (my $v = $p.err.getc).defined {
$!stderr.emit($p.err.getc);
}
}
}
$!stdout.done;
$!stderr.done;
$!merge.close;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment