- or download this
/ P e r l 6 \
Perl 5 Number String Bool
...
Bitwise NOT ~ +^ ~^ ?^, ! Logic NOT: !, not
Bitshift left << +< ~<
Bitshift right >> +> ~>
- or download this
Get a string, Get a list
Perl 5 $foo x 5 ($foo) x 5
Perl 6 $foo x 5 $foo xx 5
- or download this
$foo = $bar if not defined $foo;
$foo = $baz if not defined $foo;
$foo = $quux if not defined $foo;
- or download this
for zip(@foos, 0...) -> $foo, $i {
# Here, $foo is an element of @foo
# and $i is its index.
}
- or download this
my @sums = @foo »+« @bar;
- or download this
my @sums = map { $^a + $^b } zip(@foo, @bar);
- or download this
if $foo eq 'bar' | 'baz' | 'quux' { ... }
if $foo eq any « bar baz quux » { ... } # Other style
- or download this
if $foo eq 'bar' or $foo eq 'baz' or $foo eq 'quux' { ... }