# Pastebin hIqkjkVX #!/usr/bin/perl6 use strict; my int @primes; PRIME: loop (my $n = 2; $n <= 10_000; $n++) { # Check previous primes for @primes -> $prime { next PRIME if $n % $prime == 0; } # Verify primes are actually valid #die "Bad prime: $n" unless ($n.is-prime); push @primes, $n; } my $time = now - BEGIN now; say "Found {+@primes} primes in {$time}s ({round(+@primes / $time)} P/s)";