[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] correction on the ip address checker



assume $_ holds the ip to match.
this matches 0.0.0.0 which im not sure if it should, but then again so does the
other one.. but it is shorter, 54 bits to 44 bits and it doesnt match the bad
data (hopefully) anymore..
for(split/\./){
	++x if(/^[12]?[0-5]?[0-5]$/)
}
what a nice way to spend a weekend =)
michael salmon-
On Sun, 07 May 2000, you wrote:
> On Sun, May 07, 2000 at 08:47:18PM -0700, michael salmon wrote:
> > i could've sworn i had that fixed, like i said my mail program ( kmail ) is
> > kinda glitchy. but the fix is simple and i think its what i benchmarked it with
> > also. 
> > instead of 'if($_<256)', 'if($_>0 & $_<256)' should do the trick...
> 
> This misses the valid address 127.0.0.1
> 
> David Henderson
> --
> For the latest news about Star Trek and Buffy books, visit Psi Phi!
> Star Trek Books: http://www.psiphi.org/cgi/upc-db/           <*>
> Buffy TVS Books: http://www.psiphi.org/cgi/buffy-db/
-- 
http://www.6x4.org
"The 3 great virtues of a programmer:
  Laziness,Impatience, and hubris.
	--Larry Wall

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe