# remove non-ip-address characters, trim, break into words to validate $IP_LINE =~ tr/0-9./ /c; my @WORDS = split ' ', $IP_LINE;