We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This page has instructions on how succeed can return a value, but we don't demonstate that.
succeed
I don't know if we could show it succinctly without defining a sub
sub
sub use-succeed() { given 42 { when Int { # say "Int"; succeed "Found"; say "never this!"; } when 42 { say 42 } default { say "dunno?" } } } say use-succeed();
Or using do given, perhaps. Like my $value = do given { ... }
do given
my $value = do given { ... }
The text was updated successfully, but these errors were encountered:
Or using do given, perhaps.
Yep. Just prepend a say do in front of the existing example in the doc:
say do
say do given 42 { when Int { say "Int"; succeed "Found"; say "never this!"; } when 42 { say 42 } default { say "dunno?" } } # OUTPUT: «IntFound»
Sorry, something went wrong.
Demonstrate succeed returns a value
b01ba9e
Closes #4545
I've opened a PR with a small modification on your suggestion #4547
8e397fd
Successfully merging a pull request may close this issue.
This page has instructions on how
succeed
can return a value, but we don't demonstate that.I don't know if we could show it succinctly without defining a
sub
Or using
do given
, perhaps. Likemy $value = do given { ... }
The text was updated successfully, but these errors were encountered: