in reply to Dynamic Regex?

It looks like in your example you're saying "unless $val contains one non-alphanumeric, report an error". You could change the unless to if, or replace =~ with !~.

I also find your sub arguments a bit confusing. Your 5th is a pattern that you don't want to match, and your 6th is a word description of the pattern you do want to match. This may be leading you to your binary confusion (I get that all the time ;-).

Update: ...and I didn't catch the problem with passing the regex in the first place (/me slaps self and goes to bed)

--
I'd like to be able to assign to an luser