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


in reply to capture errors from eval

for example, expression= '/HOST=.*(' will yield a fatal die error..

Not so.

use strict; use warnings; my $w = '$expdata =~ /HOST=.*(;'; eval $w;

eval catches fatals errors and places the message in $@.