Hi Derek,
hi all (see below, please help)
> [...]
> > my $res = Net::DNS::Resolver->new;
> > my $query = $res->query(".ohnet", "NS");
> >
> >
> > if ( $query != 0 or $query != undef or $query != ' ' ) {
Please replace this condition by
if ($query)
I'm to confused at the moment to explain why in detail, sorry...
==================
hi all
while trying to prove by code that the above if condition is incorrect...
My logic says that a condition in the form
if ($a != $val1 or $a != $val2)
is always true.
sub test {print "condition is true\n" if $_[0] != 1 or $_[0] != 2}
test (1); test (2); test (3);
# this prints 3 times as expected:
condition is true
... I struggled over something when I included "undef" in some code tests:
print "Oups!\n" if 0==undef;
# prints:
Oups! # <<<<<<<< ?????
Can anybody please explain this result to me.
print "Oups!\n" if !defined 0;
# prints nothing as expected.
I thought that a had a clue of perl after using it intensively for years.
I'm not shure anymore...
greetings joe
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>