in reply to Test RegEx Validity
eval { "" =~ /$re/; $bool = 1 }; [download]
There's no need to actually use it in the eval, and you can save off the result and use it after the check.
sub validate_re { my $re = shift; eval { $re = qr/$re/ }; return $@ ? undef : $re } [download]
That will return either an already compiled regexp or undef (and $@ will indicate what was wrong in that case).