Merge pull request #1031 from brxfork/patch-1

Update perl6.html.markdown // when and smartmatch
This commit is contained in:
ven 2015-04-01 15:39:32 +02:00
commit 218de8c34d

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)