in reply to Re: regex problem
in thread regex problem

If not, then you can accomplish the same thing by using [^$pattern].

[^$pattern] is misleading. [] create a character class, so [^$characters] would be a good example. That doesn't negate a regex, though.

It's simply a matter of writing it as a normal string, and using perlfunc:eval to compile at runtime.

That requires parsing. Parsing is bad, because it's too easy to do it the wrong way. This too doesn't really answer the question.

eval !~ /$string/;

Unless you meant eval($_) !~ /$string/;, and I'm sure you didn't, that's wrong.

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$