in reply to Why does default $_ only work

As LanX said, you haven't really given enough information to go on. Please see How do I post a question effectively?, I know what I mean. Why don't you?, and Short, Self-Contained, Correct Example.

My guess would be that it has something to do with $_  =  (/(.)\1/), since that doesn't entirely make sense to me. It's the equivalent of $_ = ($_ =~ /(.)\1/), that is, you're matching the regular expression against $_ and then assigning the return value of the match back to $_. Similarly, if you wrote $selection = (/(.)\1/), then that is implicitly matching the regular expression against $_ and assigning the return value of the match to $selection. You probably meant to write $selection =~ /(.)\1/ instead.