in reply to real-time packet capture
not perl, but almost assuredly will get you the stuff you want easier and faster. ntop and ngrep.