hello, I am quite new to perl and i am not sure how do do something. I have a string $ip = "153.104.232.232" for example, and i need to compare the first 8 characters of to another IP address. Basically i want to check if that IP is part of the correct subnet. So i need the function that will "cut up" $ip and only return "153.104." so that i can compare it. How can i do this? Thank you
Example:
$ip = "153.104.233.234";
cut-up(8) $ip;
if ($ip=="153.104."){
blah blah
Example:
$ip = "153.104.233.234";
cut-up(8) $ip;
if ($ip=="153.104."){
blah blah