my $foo = 'bar';
say "match!" if $foo ~~ /bar/;
say "match!" if $foo ~~ "bar";
say "match!" if $foo ~~ Str;
say "match!" if $foo ~~ :(Int, Str);
my %lilei ='Math'=>98,'Chinese'=>'72','English'=>'128';
my %hanmeimei ='Math'=>98,'Chinese'=>'72','English'=>'128';
say "they have the same course" if %lilei.keys ~~ %hanmeimei.keys;
say 'true' if %lilei{%hanmeimei.keys} ~~ %hanmeimei.values;
my $a = 2;
say so $a ~~ 1..3;
say so $a ~~ Int;
say so $a ~~ 23;
say so $a ~~ {$_.Str ne $_.perl};
say so (1..3).ACCEPTS($a);
constant A = 100;
constant B = 100;
my (%powers, %count);
for 2..Int(sqrt A) -> \a {
next if a ~~ %powers;
%powers{a, a**2, a**3 ...^ * > A} = a X=> 1..*;
}
for %powers.values -> \p {
for 2..B -> \e {
++%count{p.key => p.value * e}
}
}
say (A - 1) * (B - 1) + %count - [+] %count.values;