in reply to text parsing

You probably want to process each line in turn instead of concatenating all input together:

while ($line = <inFile>) { chomp; if ($line =~ /^([\d\.]+)$/) { ... } }

Read perlre.

Your line if ($line=/.*?\w/) lacks the parens () in the regular expression to capture $1. Also, it matches any IP address, because each has a number which matches \w and .*? says "0 or more of any char, but the least necessary amount of them for the whole expression to match". Since you are not using ^ or $ the match can be ocurring anywhere, so it matches the first \w character in the line.

Use /^([\d\.]+)$/ to catch an ip-address, and /^([a-z]+)$/i to catch only letters from a-z (case insensitive).

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}