Basic HTML version of Foils prepared March 30 97

Foil 13 Logical Operators

From PERL4 Tutorial for CPS616 Computational Science for Information Age Course CPS616 -- February 1995. by Geoffrey C. Fox


Logical and: && as in $x && $y;
If $x is true, evaluate $y and return $y
If $x is false, evaluate $x and return $x
Logical or: || as in $x || $y;
If $x is true, evaluate $x and return $x
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



© 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 Sat Sep 6 1997