in reply to Bug in eval in pre-5.14

On pre-5.14 Perls, this is a bug.

I just wanted to mention that some of the known remaining bugs (1, 2, 3) weren't fixed until v5.28. Basically, at this point, I would never recommend eval { ... }; if ($@) { ... }.

my $success = eval { ...; 1 }; is The Right Way To Do It.* And remember that $@ could still be a false value.

* TIMTOWTDI still applies: eval { ...; 1 } or do { ... };, unless ( eval { ...; 1 } ) { ... }, my $ok = eval { ...; 1 }; if (!$ok) { ... }, and so on.