Help for this page

Select Code to Download


  1. or download this
    #use a flag to indicate a match
    
    ...
    $found ? print "\n Test -- found pattern  -- \n" 
           : print "\n Test -- did not find pattern -- \n";
    
  2. or download this
    foreach (@commands_run) {
        if($_ =~m/clock/) {
    ...
            last;   # we have a match, exit loop
        }
    }