my $Q = new Thread::Queue; # Kick this off asynchronously to put things into the # queue to read whenever we get to it async{ while(<$pipe>) { $Q->enqueue( $_ ); } $Q->enqueue( undef ); }->detach; return $Q;