in reply to Re^2: Comparing two variables when one variable includes a regexp...
in thread Comparing two variables when one variable includes a regexp...
my $regexp = <$file_handle>; my $creg = eval { qr($regexp) }; if( $@ ) { warn "regex error: $@"; } else { if( $something =~ $creg ) { # do wonderful things. } }
I apparently skipped the meat of the question because it seemed clear to me that the reason the matching failed was because of an interpolation problem with a test regexp that he generated between quotes and he wasn't actually reading it from the user -- which would have likely worked the way he had it.
-Paul
|
|---|