Fix perl warning

Warning:
  Useless use of private variable in void context at ./nsr line 162.

Switch from a for() loop using an external variable as loop counter
to a while() loop.
Feels more natural as well, which is nice.
The IPv6 0-block expansion is still one horribly piece of WTF.