in reply to
Read output from tcpdump
Just a suggestion (not a solution), why not use:
sytem 'netstat -ntu';
[download]
I aware that this drags you away from your original question, but I feel netstat is much more cool, particularly, for the purpose you mentioned in your original post.
Comment on
Re: Read output from tcpdump
Download
Code
In Section
Seekers of Perl Wisdom