mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-27 15:43:58 +00:00
Update perl6.html.markdown
($_.chars > 50) ~~ True : this is always True.
This commit is contained in:
parent
5e79da614c
commit
4c46a456bd
@ -253,7 +253,9 @@ given "foo bar" {
|
|||||||
when $_.chars > 50 { # smart matching anything with True (`$a ~~ True`) is True,
|
when $_.chars > 50 { # smart matching anything with True (`$a ~~ True`) is True,
|
||||||
# so you can also put "normal" conditionals.
|
# so you can also put "normal" conditionals.
|
||||||
# This when is equivalent to this `if`:
|
# This when is equivalent to this `if`:
|
||||||
# if ($_.chars > 50) ~~ True {...}
|
# if $_ ~~ ($_.chars > 50) {...}
|
||||||
|
# Which means:
|
||||||
|
# if $_.chars > 50 {...}
|
||||||
say "Quite a long string !";
|
say "Quite a long string !";
|
||||||
}
|
}
|
||||||
default { # same as `when *` (using the Whatever Star)
|
default { # same as `when *` (using the Whatever Star)
|
||||||
|
Loading…
Reference in New Issue
Block a user