my $ipaddr = "192.168.8.205"; my ($iprefix, $ipstuff) = $ipaddr =~ m/(\d+\.\d+)\.(\d+\.\d+)/; print $iprefix, " ", $ipstuff, "\n";