in reply to Re: Making sure user input is a valid regexp
in thread Making sure user input is a valid regexp

Good, but $! should be $@.