> On Jun 8, 2022, at 13:38, Dan Book <grinnz@gmail.com> wrote: > > As was shown in the example, you don't actually use the proposed variable yourself in try/catch as it sets up a lexical variable for the scope of catch. That would certainly encourage adoption of try/catch. > As an alternative: what if, under `use feature 'errorobject'`, $@ were the object, but without the feature it’d be the string? So the feature would only change how eval populates $@. > > This is not possible, because it is not populated lexically. I don’t think that matters: ----- { use feature 'errorobject'; eval { 9 / 0 }; } say blessed $@; # prints something { no feature 'errorobject'; eval { 9 / 0}; } say blessed $@; # prints nothing ----- Whenever $@ is populated, the relevant logic would check to see if the active feature set dictates putting the object or the string into $@. -FThread Previous | Thread Next