in reply to regular expression assistance

I think perhaps you mean:
next unless $hfileline =~/^\S*\s+$hNames/;
You want to match a "hosts" line where you have an IP (\S*) followed by whitespace (\s+) followed by the hostname. Perhaps a better regex would be:
next unless $hfileline =~/^[\d.]+\s+$hNames/;
To force matches against real lines, and not match against commented-out entries. Another way to match an IP address without using "<= 255" is:
if( $vmServerIP =~ m/^(?:(?:\d|[1-9]\d|1\d\d|2(?:[0-4]\d|5[0-5]))\.){3 +}(?:\d|[1-9]\d|1\d\d|2(?:[0-4]\d|5[0-5]))/ ){

Replies are listed 'Best First'.
Re^2: regular expression assistance
by notasaint (Novice) on May 09, 2008 at 22:14 UTC

    Great information. Thank you very much!

    -nas