Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: scandns.pl

by taint (Chaplain)
on Nov 14, 2013 at 06:00 UTC ( [id://1062535]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1062535]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-25 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found