Thx tye,
when I was researching it I did wonder why I couldn't find a similar example to the code I have to deal with, but as I implied above, this area is all new to me... and the originator is long gone...sigh.
Your version makes much more sense.
If you or anyone can explain why anyone would want to store an IP address and mask in such a complex way, I'd appreciate it.
ie why (ip & mask) => 2 concat copies of the mask?
(yes, its not an accident that $str2=$str3...)
Similarly, there are 3 other examples I need to understand that look like this style:
$mask = pack ('B32', (1 x $2), (1 x (32 - $2)));
$new {ISPP} {inet_aton ($1) & $mask} =
+
$mask . pack ('B32', (1 x 32));
ie the 2nd copy of mask is being set to 32 x 1 ?
(I intend to change the assignment of $mask to use your concat rule).
Cheers
Chris