aboutsummaryrefslogtreecommitdiff
path: root/challenge-134/abigail/perl/ch-1.pl
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-134/abigail/perl/ch-1.pl')
-rw-r--r--challenge-134/abigail/perl/ch-1.pl36
1 files changed, 36 insertions, 0 deletions
diff --git a/challenge-134/abigail/perl/ch-1.pl b/challenge-134/abigail/perl/ch-1.pl
new file mode 100644
index 0000000000..b04f5958bb
--- /dev/null
+++ b/challenge-134/abigail/perl/ch-1.pl
@@ -0,0 +1,36 @@
+#!/opt/perl/bin/perl
+
+use 5.032;
+
+use strict;
+use warnings;
+no warnings 'syntax';
+
+use experimental 'signatures';
+use experimental 'lexical_subs';
+
+#
+# See ../README.md
+#
+
+#
+# Run as: perl ch-1.pl
+#
+
+#
+# The first 40320 (= 8!) pandigital numbers in base 10 are 10 digits long,
+# all starting with '10'. The other 8 digits are all the permutations of
+# of the digits 2 .. 8.
+#
+# So, to generate the first 5 of them, we start with the first one,
+# 1023456789, chop of the last three digits (7, 8, 9), get all the
+# 6 (= 3!) permutations, sort them, throw away the last, and put them
+# after the first six digits.
+#
+
+#
+# 6 permutations, we can easily do by hand. That's quicker then searching
+# on CPAN for a module which does the work for us.
+#
+
+say "1023456$_" for qw [789 798 879 897 978];