in reply to Script with tcpdump freezes

First, you can't mix select and buffered file I/O (like <FH_END1>). You'll have to use sysread to make this work reliably.

Second, if you use tcpdump, use the -l flag, which will cause it to write its output as soon as it's available; otherwise it will wait until it has a full output buffer before writing anything.

Finally, consider using Net::Pcap instead; it's a native Perl interface to packet sniffing, and you'll probably find it's easier and more efficient than having tcpdump do the sniffing and parsing its output.