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

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" );

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