Questions about this topic? Sign up to ask in the talk tab.

Perl/Basics/Boolean Logic/Statements/And and Or

From NetSec
Revision as of 02:43, 16 July 2012 by AlizaLorenzo (Talk | contribs) (Created page with ""And" and "or" are used to apply multiple conditions to a boolean statement. * '''&&''' is the way perl represents "and" * '''||''' is the way perl represents "or" Example: {{cod...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

"And" and "or" are used to apply multiple conditions to a boolean statement.

  • && is the way perl represents "and"
  • || is the way perl represents "or"

Example:

 
  if ($age < 21 && $age >= 18) {
      print "Some content will be restricted because you are not older than 21.\n";
  }