# Whenever you want to actually see if there's something waiting my $rin = ''; my $input = ''; vec($rin, fileno(STDIN), 1) = 1; $input = if select($rin, undef, undef, 0.1);