unless statement : unless « Statement « Perl






unless statement

  

    #!/usr/local/bin/perl -w

    while (<STDIN>)
    {
       chop;
       print "I have found what I'm looking for: <$_>\n" unless $_ ne "Tom";
    }

   
    
  








Related examples in the same category

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