Basic HTML version of Foils prepared March 30 97

Foil 25 Control Structures -- What is true and false (Chapter 4 of the Llama Book)

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


1 in PERL all TESTEXPRESSION's are converted to strings and
2 Either the null string or string '0' (same as "0") is evaluated as FALSE
3 Everything else evaluates as TRUE
4 Results of Comparison Operators are what you expect
  • if ( $age < 18 ) evaluates as TRUE iff the numeric value of $age is less than 18
5 Note the numeric number 0 is converted to "0" and is FALSE as is numeric computation 1-1.
6 The string "0.000" evaluates as TRUE

in Table To:


© 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