in reply to Split on 2nd Occurence

These are all great answers, but I think we are pointing this AM in the wrong direction. He is obviously looking the the network address (which is not 192.168 it is 192.168.0.0). These solutions (not they they were not what the AM asked for) are not portable to anything but a Class B address and does not take into consideration CIDR or other netmasks (what if the netmask id 255.255.255.0 then 192.168.8.0 would the correct network for the problem). The module NetAddr-IP-3.07 will handle getting the network address and any other info the AM would want about a particular IP.
#!/usr/bin/perl use warnings; use strict; use NetAddr::IP; my $ip = new NetAddr::IP ('192.168.8.205','255.255.0.0'); my $network = $ip->network; print $network;


grep
grep> cd pub grep> more beer