my $re = eval { qr/$x/ }; if ($@) { ... } else { $string =~ $re } [download]
In reply to Re: capture errors from eval by tinita in thread capture errors from eval by sdetweil