This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Inline::Perl5; | |
my @p5 = Inline::Perl5.new xx 10; | |
my @promises = @p5.list.kv.map: -> $i, $p5 { | |
start { | |
$p5.run(q' | |
sleep $i; | |
print "hello world: $i","\n"; | |
$i; | |
'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
my $email = 'john.doe@perl6.org'; | |
my $regex = / <:L>+\.<:L>+\@<:L+:N>+\.<:L>+ /; | |
if $email ~~ $regex { | |
say $/ ~ " is a valid email"; | |
} else { | |
say "This is not a valid email"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TypeHouse { | |
has Int @.array; | |
has $!scalar; | |
has @.mystery; | |
} | |
my @types = TypeHouse.^attributes(:local); | |
for @types { .type.say } |
NewerOlder