Ascending primes: Difference between revisions

m
(Nim solution)
m (→‎{{header|Perl}}: code layout)
Line 1,345:
 
=={{header|Perl}}==
{{libheader|ntheory}}
<syntaxhighlight lang="perl">#!/usr/bin/perl
 
use strict;
use strict; # https://rosettacode.org/wiki/Ascending_primes
use warnings;
use ntheory qw( 'is_prime )';
 
print join( '', map { sprintf "%10d", $_ } sort { $a <=> $b }
map { sprintf '%10d', $_ }
grep /./ && is_prime($_),
sort { $a <=> $b }
glob join '', map "{$_,}", 1 .. 9) =~ s/.{50}\K/\n/gr;</syntaxhighlight>
grep /./ && is_prime( $_),
glob join '', map "{$_,}", 1 .. 9) =~ s/.{50}\K/\n/gr;</syntaxhighlight>
) =~ s/.{50}\K/\n/gr;
</syntaxhighlight>
{{out}}
<pre>
2,392

edits