develooper Front page | perl.perl5.porters | Postings from June 2022

Re: $@ alternative WAS Re: Core exception types [was: Re: Pre-RFC: Improve “wide character” warnings]

Thread Previous | Thread Next
From:
Branislav Zahradník
Date:
June 8, 2022 20:57
Subject:
Re: $@ alternative WAS Re: Core exception types [was: Re: Pre-RFC: Improve “wide character” warnings]
Message ID:
CAB=rbOkPZ5XTZfkxvJm-O9HTstmKgfJ3bcahQsoLGY04=dp8zQ@mail.gmail.com
> The lexical feature would only affect code that enables it specifically,
> though.
>
> It’s the same situation as signatures: the only things that would see $@
> as an object are code paths that specifically ask for that behaviour.
>
> -FG
>

when populating $@ you have to consider context of the code which consumes
it (ie handles it)
Imagine situation:
- your code can generate two exceptions
- one will be handled by code expecting $@ to be object
- second will be handled by code expecting $@ to be string

Best regards,
Brano

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