On Thursday 29 Apr 2010, Uri Guttman wrote:
> i recomment never using !~ as it doesn't read well and it makes for poor
> boolean tests. also i rarely use unless for complex (2 or more) boolean
> ops for the same reason.
> 
>   APK>  { my $result = "OK";
>   APK>    print "$result\n";
>   APK>  }
>   APK> I thought it was:
>   APK> UNLESS $result is defined and UNLESS $test does not contain TEST = IF 
> $result is not defined and if $test contains TEST.
> 
> no, that is not boolean logic. the && happens first and then the unless
> inverts that for the conditional test. a conditional is always only one
> boolean value that must be derived from the expression. unless/if
> doesn't see the multiple parts.
> 

Thank you very much Uri for the explanation. I'd learnt about "Unless" a few 
years back, but haven't been into scripting except Shell for the past few years 
and may be due to that, lost on that completely. But with you guys' help, I 
have polished it back now. :-)

-- 
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: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to