in reply to Re^2: scandns.pl
in thread scandns.pl

The eval:
$x++ if(($_>=0)&&($_<=255));
as I read it, is:
if the input ($x), is at least 0, and no greater than 255
$x is legitimate, so return $x

So as I see it. There is nothing afoul with my proposed solution.

:)

--Chris

#!/usr/bin/perl -Tw
use Perl::Always or die;
my $perl_version = (5.12.5);
print $perl_version;

Replies are listed 'Best First'.
Re^4: scandns.pl
by jdporter (Paladin) on Nov 14, 2013 at 20:12 UTC
    as I read it...

    You're reading it wrong.

    $x is counting the number of valid octets. The number of valid octets should be 4, not simply >0. It's fine to return 4 rather than 'true', but it is not fine to return 1 or 2 or 3. The number of the counting shall be 4.

    I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.