Conditional operator: The unless Modifier : unless « Statement « Perl






Conditional operator: The unless Modifier

  

# Format: Expression2 unless Expression1;

$x=5;
print $x unless $x == 6;

   
    
  








Related examples in the same category

1.The unless Construct
2.The unless statement is the opposite of if and executes a block unless a condition is true.
3.Using unless with regular expression
4.unless statement
5.unless statement in while
6.unless statement with else
7.unless statement with elsif