Help for this page

Select Code to Download


  1. or download this
    if ($string =~ /(foo(?{ $N = 1 }))|(bar(?{ $N = 1 }))/) {
      if ($N == 1) { ... }
      else { ... }
    }
    
  2. or download this
    if (my @capt = $string =~ /(foo)|(bar)/) {
      $N = @capt;
    ...
      if ($N == 1) { ... }
      else { ... }
    }