[EMAIL PROTECTED] wrote:
All,

Can someone explain this code line by line?
Obviously I understand most of it but lines 4, 5, 6 and 10 I am fuzzy.

For line 4: if ($query) ..... if what? Here I would expect to see if ( -s

If it has a value (IE is not '',0, or undef)

$query  ) or something like a return code/exit code value check like $? >>
8.
What is if ($query) saying?  Is there a more beginner way?  After line 3
could I check the exit value then  run a more obvious if statement?

if $query has a value do this that and the other.

For line 5: foreach my $rr, we are looking for a record string eq to
NS(nameserver)  from $query answer?  But where does $rr, $_ and answer come
from?

From the object created in $res->query("example.com", "NS");

This entire line is fuzzy to me.  Is there a more beginner way ?  I would
probably write it like:

Do it however you like according to the Net::DNS docs...

            foreach ($query->answer) {
                  if ( $_ eq NS) {
                        print  $rr->nsdname, "\n";
                  }
            }


For line 10: $res->errorstring. Where does errorstring come from? Are

From the object created in $res->query("example.com", "NS"); if there is an error.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to