my $t1 = async{ 1 while <$out> }; my $t2 = async{ 1 while <$err> }; $_->join for $t1, $t2; ...