$_ = 'abcdefghijk'; my($left) =1; if($left){ /ab(..)ef/} else{ /gh(..)jk/}; print "Caught $1\n"