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

Difference between revisions of "Perl/Basics/Boolean Logic/Statements/And and Or"

From NetSec
Jump to: navigation, search
(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...")
 
 
(No difference)

Latest revision as of 02:15, 19 July 2012

"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";
  }