print("****************"); open(FH_END1, "$TCPDUMP -v -lnnet -i eth1 -s 1000|") || die; print("****************"); my $select = IO::Select->new(); $select->add(*FH_END1); while(1){ print("1"); while (my @ready = $select->can_read(5)){ print("2"); foreach my $fh (@ready){ my $line = ; #check if line is valid and take some actions #....