for my $n (2 .. 99) { for my $x (2 .. $n - 1) { goto NOT_PRIME if 0 == $n % $x; } PRIME: say $n, ' is a prime number'; NOT_PRIME: }