From f4f3d93f551953a75aecef48689cf599b60cd55e Mon Sep 17 00:00:00 2001 From: Jörg Sommrey <28217714+jo-37@users.noreply.github.com> Date: Mon, 26 Apr 2021 14:10:12 +0200 Subject: Solution to task 1 --- challenge-110/jo-37/perl/ch-1.pl | 97 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100755 challenge-110/jo-37/perl/ch-1.pl diff --git a/challenge-110/jo-37/perl/ch-1.pl b/challenge-110/jo-37/perl/ch-1.pl new file mode 100755 index 0000000000..431e48c1b2 --- /dev/null +++ b/challenge-110/jo-37/perl/ch-1.pl @@ -0,0 +1,97 @@ +#!/usr/bin/perl -s + +use v5.16; +use Test2::V0; +use experimental 'signatures'; + +our ($tests, $examples); + +run_tests() if $tests || $examples; # does not return + +die <) { + push @num, /((?:\+\d{2}|\(\d{2}\)|(? Date: Mon, 26 Apr 2021 20:35:57 +0200 Subject: Solution to task 2 --- challenge-110/jo-37/perl/ch-2.pl | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100755 challenge-110/jo-37/perl/ch-2.pl diff --git a/challenge-110/jo-37/perl/ch-2.pl b/challenge-110/jo-37/perl/ch-2.pl new file mode 100755 index 0000000000..a833da13f1 --- /dev/null +++ b/challenge-110/jo-37/perl/ch-2.pl @@ -0,0 +1,71 @@ +#!/usr/bin/perl -s + +use v5.16; +use Test2::V0; +use experimental qw(signatures postderef); + +our $examples; + +run_tests() if $examples; # does not return + +die <) { + my @part = split /,|\n/; + while (my ($i, $v) = each @part) { + push $tr[$i]->@*, $v; + } + } + + @tr; +} + + +### Examples and tests + +sub run_tests { + open my $fh, '<', \(<