(@segments) = split(/\./,$ip); foreach(@segments) { print unpack("B*",chr($_)); }