http://www.perlmonks.org?node_id=549288


in reply to Re: Small examples of string eval
in thread Small examples of string eval

eval { @result = $dbh->selectrow_array($query) }; return my_custom_error_handler("selectrow_array $query") if $@;
That is an example of block eval, not string eval; the OP was asking about string eval. There is wide agreement that block eval is a good thing in Perl 5 (for exception handling). Overloading eval with two different meanings in Perl 5 was unfortunate and is fixed in Perl 6, where block eval is spelled try.