Help for this page
if ($string =~ /(foo(?{ $N = 1 }))|(bar(?{ $N = 1 }))/) { if ($N == 1) { ... } else { ... } }
if (my @capt = $string =~ /(foo)|(bar)/) { $N = @capt; ... if ($N == 1) { ... } else { ... } }