in reply to Need help in perl regexp

It simply "doesn't work" because your regexp doesn't match your data. Not "/" but "." seperates the port from the IP.

while (<DATA>) { my ( $src_ip, $src_port ) = /IP\s+(\d+(?:\.\d+){3})\.(\d+)/; my ( $dst_ip, $dst_port ) = />\s+(\d+(?:\.\d+){3})\.(\d+)/; print "$src_ip $src_port $dst_ip $dst_port \n"; } __DATA__ 12-APR-03 12:20:46.902801 IP 10.60.0.114.2684 > 10.60.0.3.110: . ack 3 +927995843 win 0

s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e