http://www.perlmonks.org?node_id=318132


in reply to = rather than =~ ?

It depends. I don't know what $input is, but that code is matching against $_. If the match fails, the match fails. Such code should always be written something like $foo = $1 if /(foo)/;