in reply to "exact" pattern matching
Not sure how trusted your users are but, once you're done solving this problem, you might want to check out taint mode (do a perldoc perlsec).