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

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

Message ID:

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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About