develooper Front page | perl.perl5.porters | Postings from July 2023

Thread Previous | Thread Next
From:
"Ruud H.G. van Tol" via perl5-porters
Date:
July 17, 2023 15:27
Subject:

Message ID:
93b602dc-230b-7643-09a2-a602b312638a@isolution.nl

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].

-- Ruud


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About