|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: Re: validateMask (regex tweak, 30bit mask, CPAN modules)by idnopheq (Chaplain) |
| on May 09, 2001 at 14:51 UTC ( [id://79106]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
THX for the comments ... I rewrote the validateMask sub, including your
My new version is far simpler than my original post, using Socket, unpack, and join to give a 32 character binary string, then searching for the pattern /01/. If we find it, bad mask. Everything else then must be good ( unless someone finds a fatal flaw here, too! :b ). I wasn't initially that excited about requiring Socket, but then I figured this will likely be used (if at all) in a networking script, so Socket.pm is ok.
In Section
Cool Uses for Perl
|
|
||||||||||||||||||||||||