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

Re: [FWP] IP address regex golf



On Sat, Apr 29, 2000 at 02:05:03PM -0500, Keith Calvert Ivey wrote:
> John Porter <jdporter@min.net> wrote:
> 
> >   require 5.6;
> > 
> >   $b = eval; # assuming string to test is in $_
> >   $a = eval '255.255.255.255';
> >   print( ( $a | $b ) eq $a ? "Yes\n" : "No\n" );
> 
> Don't you need 'v' in front of those tuples?  Or is that
> somehow optional, even though that would break older programs
> that concatenated numbers?  I'd have thought the second and 
> third lines should be
> 
>    $b = eval "v$_";
>    $a = v255.255.255.255;
> 
> But then I haven't used 5.6 yet.

Don't get me started...  The v is optional for dotted tuples that contain
more than one dot.  This is the decision that was made on p5p, despite
objections from myself and others.

If you have programs that concatenate numbers, you are SOL.  But I amm more
concerned about the confusion between 255.255 and 255.255.255, only one of
which is a tuple.

Ronald

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