Skip to content

Instantly share code, notes, and snippets.

View titsuki's full-sized avatar

Itsuki Toyota titsuki

View GitHub Profile
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;
');
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";
}
class TypeHouse {
has Int @.array;
has $!scalar;
has @.mystery;
}
my @types = TypeHouse.^attributes(:local);
for @types { .type.say }