in reply to Dotless IP address problem

The problem is that you're using the fact that integers "flip over" the sign barrier at high numbers. However, there's one more negative number than positive number (due to the fact that 2's complement is a negative vs. non-negative representation system).

The solution is to add a $dotless++ before the loop to decode it. That gives the right answer.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.