mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-01 04:20:39 +02:00
Update perl6.html.markdown
($_.chars > 50) ~~ True : this is always True.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user