Front page | perl.perl5.porters |
Postings from July 2023
From: "Ruud H.G. van Tol" via perl5-porters
July 17, 2023 15:27
Message ID: firstname.lastname@example.org
On 2023-07-17 17:15, demerphq wrote:
> The problem with throwing objects is that there is no standard way to
> allow them to be modified by the calling code to add data to the
> error. With strings it is obvious how you can change them, but
> unfortunately you change the context the error was thrown from.
> For example in
> eval $code or die "While executing $code: $@";
> the error is extended, but its source changes. The error would be
> reported as coming from the line where the eval was executed, not
> where the exception actually occurred.
I think we also still have @@ available, to use as a stack.
Maybe $@ should represent $@[-1].