summaryrefslogtreecommitdiff
path: root/perl/Primes.pm
diff options
context:
space:
mode:
authorGuillermo Ramos2019-04-26 21:21:12 +0200
committerGuillermo Ramos2019-04-26 21:21:12 +0200
commit6961d56205c8a62216d29f87640d6f25d386ace2 (patch)
treecc32bf9a1957a9e92d2c20d53a978489cf3b36cf /perl/Primes.pm
parent6be991fc143b51a6f51a2458000afcaf577f6ac0 (diff)
downloadeuler-master.tar.gz
[perl] Primes.pmHEADmaster
Diffstat (limited to 'perl/Primes.pm')
-rw-r--r--perl/Primes.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/perl/Primes.pm b/perl/Primes.pm
new file mode 100644
index 0000000..6843210
--- /dev/null
+++ b/perl/Primes.pm
@@ -0,0 +1,13 @@
+package Primes;
+
+my $last_prime = 2;
+my @primes = (2);
+
+sub sieve {
+ my $n = shift;
+ push @primes, $n;
+ my @copy = @primes;
+ return \@copy;
+}
+
+1;