in reply to replacing the last portions of an octet
Here's another option:
my $IPs = '192.168.1.1-192.168.1.254';
$IPs =~ s/(.+\.)(\d+)(\s*-\s*.+\.)(\d+)/$1 . ($2 - 1) . $3 . ($4 + 1)/
Electric eels were invented at the same time as electricity
Before electricity was invented, electric eels had to stun with gas
Results (360 votes). Check out past polls.