1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-01-17 21:49:22 +01:00

Update perl6.html.markdown

($_.chars > 50) ~~ True : this is always True.
This commit is contained in:
Philippe Bricout 2015-04-01 15:13:59 +02:00
parent 5e79da614c
commit 4c46a456bd

View File

@ -253,7 +253,9 @@ given "foo bar" {
when $_.chars > 50 { # smart matching anything with True (`$a ~~ True`) is True,
# so you can also put "normal" conditionals.
# This when is equivalent to this `if`:
# if ($_.chars > 50) ~~ True {...}
# if $_ ~~ ($_.chars > 50) {...}
# Which means:
# if $_.chars > 50 {...}
say "Quite a long string !";
}
default { # same as `when *` (using the Whatever Star)