in reply to Re: IP Iterator
in thread IP Iterator

2.) array worked thanks my code got better. i made the change.

3.) still working on understanding the change but would the solution include incrementing the next octet if $_[i-1] hits 255?

Replies are listed 'Best First'.
Re^3: IP Iterator
by camlet (Novice) on Apr 17, 2008 at 17:21 UTC
    3) the recommended change doesn't include verifying octet[i-1]

    $ip = $_[0]; # your 32-bit int $arr[3] = $ip & 255; $ip >>= 8; $arr[2] = $ip & 255; $ip >>= 8; $arr[1] = $ip & 255; $ip >>= 8; $arr[0] = $ip & 255;