I don't know why you think you need to escape the / character. You're using the q quoting mechanism, so the $input is not interpolated, thus it is the regex compiler, not the perl parser, that sees the / so if you're worried about a / being used to terminate the regex, that won't happen. That being said, if you are escaping a character, you may also want to escape the \ character, in your example an $input of '\/' would become '\\/' which does not have an escaped /
Comment on Re: Checking user input on dynamic regular expressions