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.
In reply to Re: Bug in eval in pre-5.28
by haukex
in thread Bug in eval in pre-5.14
by choroba
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |