my (@octets) = split /\./,$input_string; my $output_string = sprintf "%d\.%d\.%d\.%d", $octets[0], $octets[1], $octets[2], $octets[3];