if ($search_term =~ m[^/.*/\w*$]) { # if it is in the form "/foo/x" or whatever, treat it as # though it had been specified in Perl program text $search_re = qr($search_term); } #### $search_re = eval("qr${search_term}");