Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.
my $ip = "96.8.256.1";
my @list = split /\./,$ip;
if ( $list[0] == "96" &&
( $list[1] >= 6 && $list[1] <= 7) &&
( $list[2] >= 1 && $list[2] <=255) &&
( $list[3] >= 1 && $list[3] <=255) ) {
print "ok";
}else{
print "ip not ok";
}
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.