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

Re: [FWP] IP address regex golf



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.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC

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