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

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

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