my $Qstdin = new Thread::Queue; async { $Qstdin->enqueue( $_ ) while defined( $_ = ); }->detach; ... my $kbinput = $Qstdin->dequeue;