Dang, you are correct! I never write $foo =~ $pat so as the seeker of wisdom needed to be using this construct I *quickly* checked it to see if it worked using the code posted. As you rightly point out although this appeared to work in my quick test if I had also tested this: $pat = m/foo/; print "big snafu, egg on face, whoops\n" if "bar" =~ $pat; then my error would have stared me in the face! Thanks for pointing out the error, I hate to post wrong advice and usually run a quick test first. Ah well, another day at the monestry, another snippet of wisdom on the road to enlightenment. As a result the original code will need a qr/$pat/ to work. head bowed, duly chastened :-( tachyon PS this is what you need to get it to work. Trust me ;-) $pat = qr/some pattern here/; ... ... ... sub paramCheck # Returns "" if no error or description of problem(s). { ... my $pat = shift; ... ... if ( $val !~ m/$pat/ ) { $err .= wes( "$lbl contains invalid characters; " . "it can only hold $msg." ); } return $err; }