Skip to content

Commit 7a52a1d

Browse files
committed
perldelta for 'catch (my $e)' diagnostic
1 parent 6059148 commit 7a52a1d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pod/perldelta.pod

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,22 @@ and L</New Warnings>
198198

199199
XXX L<message|perldiag/"message">
200200

201+
=item *
202+
203+
L<Can't redeclare catch variable as "%s"|perldiag/"Can't redeclare catch variable as "%s"">
204+
205+
(F) A C<my>, C<our> or C<state> keyword was used with the exception variable in
206+
a C<catch> block:
207+
208+
try { ... }
209+
catch (my $e) { ... }
210+
# or catch (our $e) { ... }
211+
# or catch (state $e) { ... }
212+
213+
This is not valid syntax. C<catch> takes a bare variable name, which is
214+
automatically lexically declared.
215+
[GH #23222]
216+
201217
=back
202218

203219
=head3 New Warnings

0 commit comments

Comments
 (0)