use IO::Select; $s = IO::Select->new(); $s->add(\*STDIN); if ($s->can_read(0)) { # Non-blocking check. # Something to read! } else { # Nothing to read. }