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

RE: [FWP] IP address regex golf



> From: David L. Nicol [mailto:david@kasey.umkc.edu]
> Sent: Tuesday, May 09, 2000 17:15
> To: John Porter
> Cc: fwp@technofile.org
> Subject: Re: [FWP] IP address regex golf
>
>
>
> You meant this, right? (haven't got 5.6 running on anything here yet)
>
>
>    require 5.6;
>
>    $a = eval "v$_"; # assuming string to test is in $_
>    $b = v255.255.255.255;
>    print( ( $a | $b ) eq $a ? "Yes\n" : "No\n" );
                           ^^
                           $b

--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com



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