% cat t0 #!/usr/bin/perl use strict; use warnings; use IO::Select; $|=1; warn "pid $$ checking pipe\n"; my $s = IO::Select->new(); $s->add(\*STDIN); if ($s->can_read(.5)) { warn "pid $$ can read\n"; print "here is my table\n"; } else { warn "pid $$ cannot read\n"; } % ./t0 | ./t0 pid 24811 checking pipe pid 24810 checking pipe pid 24811 cannot read pid 24810 cannot read % echo "go" | ./t0 | ./t0 pid 26452 checking pipe pid 26452 can read pid 26453 checking pipe pid 26453 can read here is my table %