in reply to Catching error in DateTime::Format
A simple die prints $@ of last failed eval, even without explicitly telling it to do so. And that's confusing if you decided to move on from the failed eval and then you throw a die and it talks about past things... Perhaps something else in the code or Test::More does similar?
use strict; use warnings; use DateTime; my $x = eval{ DateTime->from_epoch(epoch=>'xxxx'); }; print "xx\n"; die; # moving on to other business: my $z = 1; #eval { 1 }; # "reset" $@ die; # still displays the $@ of last failed eval which is irrelevant a +t this point in the code!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Catching error in DateTime::Format
by Anonymous Monk on Oct 28, 2025 at 13:16 UTC | |
by bliako (Abbot) on Oct 28, 2025 at 14:14 UTC | |
by ysth (Canon) on Oct 29, 2025 at 18:57 UTC |