#!/usr/bin/perl use IO::Select; if ($::child_pid = open (CHILD, "|-")) { { my $h = select(CHILD); $|=1; select($h); } sleep 1; # allow the child's select mechnanism to start for (1..8) { my $s = "ADD I 1 $_ 50.0.5.$_\n"; print CHILD $s; print "Tx: $s"; } while (1) { sleep 1; } } else { my $select = IO::Select->new(\*STDIN); while (1) { print "waiting for more data\n"; foreach my $client ($select->can_read(1)) { $_ = <$client>; chomp; print "\tRx: $_ => "; for (1..5) { # time for my $foo (keys %::) { # waster $zub = \&{$::{$foo}}; # to } # induce } # problem print "\tDone\n"; } if ($::i++ == 10) { my $a = ; print "ALSO READ: $a\n"; } } }