On Wed, Jun 8, 2022 at 1:29 PM Felipe Gasper <felipe@felipegasper.com> wrote: > > > On Jun 8, 2022, at 12:25, Paul LeoNerd Evans <leonerd@leonerd.org.uk> > wrote: > > > > We can't change the existing behaviour of $@, but we *could* create > > some other variable, say, ${^EXCEPTION}, that would receive these new > > objects, and say that actually the catch var uses that instead: > > An interesting idea. I guess all of the available punctuation variables > are taken, though? > > It would be a shame if, to access the new-hotness, one had to work harder > to type ${^EXCEPTION} as opposed to just $@. > > 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. As Ovid indicated, just making $@ a stringifying object would prevent > breakage except in esoteric cases. If itâs behind a feature flag then > thatâll make those cases all the rarer. So I, at least, donât see why there > seems to be such resistance. > > Itâs already hard for neophytes to juggle $@, $!, $?, and $^E. Adding a > 5th âerror variableâ seems likely to worsen that. > > 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. -DanThread Previous | Thread Next