Subject: | eval() makes $@ not usable |
After eval() method $@ becomes always empty. Even after explicit die(). This makes exceptions handling not usable.
Try test below. Expected output: "Error - Fatality!". Actual output: "No errors".
use strict;
use WWW::Scripter;
eval {
my $scripter = WWW::Scripter->new;
$scripter->use_plugin('JavaScript');
$scripter->eval("var t = false;");
die "Fatality!";
};
if (my $err = $@) {
die "Error - $err";
}
warn "No errors";