in reply to Check IP with support for CIDR
You can simplify the CIDR mask check:
return unpack ('N', pack ('C4', split /\./, $i) ^ pack ('C4', split /\ +./, $1)) >> 32 - $2;
MeowChow s aamecha.s a..a\u$&owag.print
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (MeowChow) Re: Check IP with support for CIDR
by xaphod (Monk) on Apr 12, 2002 at 08:06 UTC | |
by MeowChow (Vicar) on Apr 12, 2002 at 08:30 UTC | |
by xaphod (Monk) on Apr 12, 2002 at 08:56 UTC |
In Section
Cool Uses for Perl