Basic HTML version of Foils prepared Sept 20 97

Foil 15 Logical Operators

From Tutorial on PERL Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


Logical and: && as in $x && $y;
If $x is true, evaluate $y and return $y
If $x is false, don't eval $y and return false
Logical or: || as in $x || $y;
If $x is true, don't evaluate $y and return true
If $x is false, evaluate $y and return $y
Logical Not: ! as in ! $x;
Return not $x
and is same as &&, or the same as || and not is same as ! but lower (indeed lowest) precedence (see Table 2-3 in Llama Book)



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Sep 21 1997