in reply to Re^5: conditional catch-blocks 'try {} catch(COND) { }'
in thread conditional catch-blocks 'try {} catch(COND) { }'
May I see a POC with prototypes for that?
Because this
> sub catchif ($&;@)will require a sub before and a comma after the block.
You are right. It would have been too easy. ;-) perlsub is quite clear:
An & requires an anonymous subroutine, which, if passed as the first argument, does not require the sub keyword or a subsequent comma.
I did not remember the "first argument" exception and assumed an anonymous sub would work in any position.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: conditional catch-blocks 'try {} catch(COND) { }'
by LanX (Saint) on Sep 21, 2021 at 21:33 UTC |