in reply to Question on evaulating a user built regex

If you use "" with eval, make sure you escape the $ in '$user_text'; otherwise, it'll be interpolated into a constant string.
sub do_it{ #... eval "\$user_text =~ $regex"; if (length $@){ print "Error : $@"; }else{ print "User text: $user_text\n" } #...

--perlplexer