my $s = IO::Select->new; my $dxc_fifo="/tmp/dxc_fifo"; my $fifo_str; open my $fifo_fh, "+>", "$dxc_fifo" or die "could not open $dxc_fifo\n"; $s->add($fifo_fh); print $fifo_fh "START\n"; my $i=0; while (1) { sleep 1; $i++; print "loop #$i \n"; my @files = $s->can_read(.25); if (@files) { for my $fh (@files) { my $line = <$fh>; if ($line) { print "from pipe: $line"; } } } }