Skip to content

Instantly share code, notes, and snippets.

@AlexDaniel
Created April 24, 2018 01:15
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 AlexDaniel/6ce255c821a6e60e7e74dfbf3eadbddf to your computer and use it in GitHub Desktop.
Save AlexDaniel/6ce255c821a6e60e7e74dfbf3eadbddf to your computer and use it in GitHub Desktop.
my $p := Proc::Async.new: ‘perl’, '-wE', 「
for (1..100000) { print STDOUT "Hello standard output!\n"; print STDERR "Hello standard output!\n"; }
」;
my atomicint $x;
$p.stdout.tap: { $x⚛+=+.lines }
$p.stderr.tap: { $x⚛+=+.lines }
await $p.start;
say $x;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment