use Socket; # extract the source IP addr into dotted quad form my $source = inet_ntoa substr $packet, $src_ip, 4; # extract the destination IP addr into dotted quad form my $destination = inet_ntoa substr $packet, $dst_ip, 4;