Hi,
Could someone explain this condition:
Scenario: #1
unless ( (defined $result) && ($test !~ /TEST/) )
{ my $result = "OK";
print "$result\n";
}
I thought it was:
UNLESS (IF NOT) $result is defined and UNLESS (IF NOT) $test does contain TEST
But that doesn't seem to be the case.
I find it strange to learn that the below condition is not the same:
Scenario: #2
unless (defined $result)
{
unless ($test !~ /TEST/)
{ my $result = "OK";
print "$result\n";
}
}
This would work as I thought (UNLESS $result is defined and UNLESS $test does
contain TEST), but not the scenario #1.
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/