·  PERL – Syntax – Operators – Logical

 

- Info:

  - This tutorial shows how to use Conditional Operators: && || !.

  - They are used to create complex logical structures from individual Comparison Operations.

 

- Test.pl

  #Test variables.-------------------------------------------------------------------

  $left  = 65;

  $right = 70;      

   

  #Logical operators.----------------------------------------------------------------

  if ( $left> 50 && $right==70 ) { print('$left >50 AND $right==10' ); }

  if ( $left!=50 || $right> 90 ) { print('$left!=50 OR  $right> 90' ); }

  if (           !  ($left==80)) { print('$left is  NOT equal to 80'); }