aboutsummaryrefslogtreecommitdiff
path: root/challenge-107
diff options
context:
space:
mode:
authorE. Choroba <choroba@matfyz.cz>2021-04-05 21:54:17 +0200
committerE. Choroba <choroba@matfyz.cz>2021-04-05 21:54:17 +0200
commitf37645323a12f7b5cd88e90797c6dd0b791b3ffa (patch)
tree2c71210e6995558c00795e08fdb8cfc8f8536910 /challenge-107
parentd44b2193b81c369285cf9ee9f9e5efa5104859e2 (diff)
downloadperlweeklychallenge-club-f37645323a12f7b5cd88e90797c6dd0b791b3ffa.tar.gz
perlweeklychallenge-club-f37645323a12f7b5cd88e90797c6dd0b791b3ffa.tar.bz2
perlweeklychallenge-club-f37645323a12f7b5cd88e90797c6dd0b791b3ffa.zip
Add solution to 107: List Methods by E. Choroba
Reuse 043 for the solution of Self-descriptive Numbers.
Diffstat (limited to 'challenge-107')
-rwxr-xr-xchallenge-107/e-choroba/perl/ch-1.pl2
-rwxr-xr-xchallenge-107/e-choroba/perl/ch-2.pl12
-rw-r--r--challenge-107/e-choroba/perl/lib/Calc.pm11
3 files changed, 25 insertions, 0 deletions
diff --git a/challenge-107/e-choroba/perl/ch-1.pl b/challenge-107/e-choroba/perl/ch-1.pl
new file mode 100755
index 0000000000..15e4e6f184
--- /dev/null
+++ b/challenge-107/e-choroba/perl/ch-1.pl
@@ -0,0 +1,2 @@
+#!/usr/bin/perl
+exec '../../../challenge-043/e-choroba/perl/ch-2.pl'
diff --git a/challenge-107/e-choroba/perl/ch-2.pl b/challenge-107/e-choroba/perl/ch-2.pl
new file mode 100755
index 0000000000..4690df6ed8
--- /dev/null
+++ b/challenge-107/e-choroba/perl/ch-2.pl
@@ -0,0 +1,12 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use feature qw{ say };
+
+use lib './lib';
+use Calc ();
+
+say for keys %{Calc::};
+
+# Inlining the package in the main file excludes the BEGIN. Not
+# specifying the "no import ()" adds "import" to the list.
diff --git a/challenge-107/e-choroba/perl/lib/Calc.pm b/challenge-107/e-choroba/perl/lib/Calc.pm
new file mode 100644
index 0000000000..b5d92fc718
--- /dev/null
+++ b/challenge-107/e-choroba/perl/lib/Calc.pm
@@ -0,0 +1,11 @@
+package Calc;
+
+use warnings;
+use strict;
+
+sub new { bless {}, shift; }
+sub add { }
+sub mul { }
+sub div { }
+
+__PACKAGE__