Help for this page

Select Code to Download


  1. or download this
    if ($var =~ /^[qw(Smith Jones Schmidtz)]/)
  2. or download this
    my @names = qw(Smith Jones Schmidtz);
    my $pattern = join '|', @names;
    
    ...
    
    # or quicker
    if ($var =~ /^Smith/ || $var =~ /^Jones/ || $var =~ /^Schmidtz/)