I have written this code, but it does not work. Can someone point out the issue?
sub match_ip() { my $ip = \"The IP address is 216.108.225.236:60099\"; i
$ip = "10.255.256.1"; # will accept valid ips if ($ip =~ m/^([1|2][0-9]{1,2})\.([0-255]{1,3}\.){2}[0-255]{1,3}/ && ($1 <=255)) { print "This is a valid ip: $ip \n"; } else { print "This is not a valid ip: $ip \n"; }