summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2021-11-22 21:58:33 +0000
committerPaul Evans <leonerd@leonerd.org.uk>2021-11-23 17:59:07 +0000
commit315aa462c3428ddd2c98859439cef0a0a9edbb67 (patch)
treeb3f309d3b5a355bc65a6f3be1a10f8a804fe7f34 /pod
parente62a62a08b0c8568cfc68c82661b8e23f728477d (diff)
downloadperl-315aa462c3428ddd2c98859439cef0a0a9edbb67.tar.gz
Forbid using 'goto' to jump into a 'defer' block because everything will break when it's done
Diffstat (limited to 'pod')
-rw-r--r--pod/perldiag.pod5
1 files changed, 5 insertions, 0 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 97a974f97f..468f29859f 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -1042,6 +1042,11 @@ error occurs in cases such as these:
goto G;
$x + do { G: $y }; # How is + supposed to get its first operand?
+=item Can't "goto" into a defer block
+
+(F) A "goto" statement was executed to jump into the scope of a defer
+block. This is not permitted.
+
=item Can't "goto" into a "given" block
(F) A "goto" statement was executed to jump into the middle of a C<given>