in reply to Regular Expression to Match IP Address
$input = <STDIN>; chomp $input; $input =~ /\d+\.\d+\.\d+\.\d+/ or die "bad input"; foreach $k($input =~ /\d+/g) { die "bad input" if($k<0 or $k>255); } [download]