From d1bb39457a8845dd5b2df2c9dfd9b9c12d5c260f Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Mon, 28 Apr 2025 03:23:41 +0200 Subject: [PATCH] perldelta for 'catch (my $e)' diagnostic --- pod/perldelta.pod | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 3111cf685f..495b14061d 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -198,6 +198,22 @@ and L XXX L +=item * + +L + +(F) A C, C or C keyword was used with the exception variable in +a C block: + + try { ... } + catch (my $e) { ... } + # or catch (our $e) { ... } + # or catch (state $e) { ... } + +This is not valid syntax. C takes a bare variable name, which is +automatically lexically declared. +[GH #23222] + =back =head3 New Warnings