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

Re: [FWP] ip address golf-eek!



Again...

for(split/\./,$_,4){$x++ if(/^\d{1,3}$/&$_<256)}

like brother payneinthe pointed out on #perl... the previous also
validated 123.123.123.a.123 ... so to cut it in 4 we add a few chars and
end up with 56 bits...

Arjen

---
A conclusion is simply the place where you got tired of thinking.

On Mon, 8 May 2000, Arjen Wiersma wrote:

> Hey micheal,
> 
> for(split/\./){++x if(/^\d{1,3}$/&$_<256)}
> 
> 49... up for the last hole?
> 
> Arjen
> 
> On Sun, 7 May 2000, michael salmon wrote:
> 
> > before i get too flamed let me make my (hopefully again.) last correction!
> > if(/^[12]?[0-9]?[0-9]?$/&$_<256)
> > now im only 3 shorter, big whoop.. let me recede to the shadows now before i
> > look worse -- 
> > 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
> > 
> 
> 


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