Help for this page

Select Code to Download


  1. or download this
    my $valid = join "|", @valid;
    print "okay" if /^$valid$/;
    
  2. or download this
    # don't run this code on every match: the idea is the qr// needs
    # to be computed only once.
    ...
    # now match as many times as you like.
    print "$_: " . (/$valid_re/ ? "okay" : "not okay") . "\n"
            for @a_bunch_of_inputs;