-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document return interaction with do BLOCK #16841
Comments
From @GrinnzThe documentation for return currently states that it will return from -Dan (Perl) |
From @GrinnzPatch attached. |
From @Grinnzperl_return_do.patchdiff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 973a2612d7..f6b8788849 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -6682,8 +6682,8 @@ X<return>
Returns from a subroutine, L<C<eval>|/eval EXPR>,
L<C<do FILE>|/do EXPR>, L<C<sort>|/sort SUBNAME LIST> block or regex
-eval block (but not a L<C<grep>|/grep BLOCK LIST> or
-L<C<map>|/map BLOCK LIST> block) with the value
+eval block (but not a L<C<grep>|/grep BLOCK LIST>,
+L<C<map>|/map BLOCK LIST>, or L<C<do BLOCK>|/do BLOCK> block) with the value
given in EXPR. Evaluation of EXPR may be in list, scalar, or void
context, depending on how the return value will be used, and the context
may vary from one execution to the next (see
|
From @GrinnzReformatted with git format-patch. |
From @Grinnz0001-Mention-that-you-cannot-return-from-do-BLOCK.patchFrom 3f8b2d87be3237ce711d21e85232442493fb1d47 Mon Sep 17 00:00:00 2001
From: Dan Book <grinnz@grinnz.com>
Date: Tue, 5 Feb 2019 17:41:18 -0500
Subject: [PATCH] Mention that you cannot return from do BLOCK
---
pod/perlfunc.pod | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 973a2612d7..f6b8788849 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -6682,8 +6682,8 @@ X<return>
Returns from a subroutine, L<C<eval>|/eval EXPR>,
L<C<do FILE>|/do EXPR>, L<C<sort>|/sort SUBNAME LIST> block or regex
-eval block (but not a L<C<grep>|/grep BLOCK LIST> or
-L<C<map>|/map BLOCK LIST> block) with the value
+eval block (but not a L<C<grep>|/grep BLOCK LIST>,
+L<C<map>|/map BLOCK LIST>, or L<C<do BLOCK>|/do BLOCK> block) with the value
given in EXPR. Evaluation of EXPR may be in list, scalar, or void
context, depending on how the return value will be used, and the context
may vary from one execution to the next (see
--
2.20.1
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migrated from rt.perl.org#133826 (status was 'new')
Searchable as RT133826$
The text was updated successfully, but these errors were encountered: