Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    
    if ( grep $string =~ /$_/, @chars ) { print "OK"; }
    else { print "Oops"; }
    
  2. or download this
    foreach (@chars) {
    if ($string =~ /$_/) { $anymatches++ }
    }
    if ($anymatches) { print "OK" }
    else { print "Oops" }