From 95904ab68f94e48573efe43bc846314b3a799ce3 Mon Sep 17 00:00:00 2001 From: Jörg Sommrey <28217714+jo-37@users.noreply.github.com> Date: Wed, 29 Mar 2023 19:18:34 +0200 Subject: Challenge 034 task 2 --- challenge-034/jo-37/perl/ch-2.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 challenge-034/jo-37/perl/ch-2.pl diff --git a/challenge-034/jo-37/perl/ch-2.pl b/challenge-034/jo-37/perl/ch-2.pl new file mode 100755 index 0000000000..381e70decf --- /dev/null +++ b/challenge-034/jo-37/perl/ch-2.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +main: { + my @dispatch = ( + sub {print 'The'; 7}, + sub {print '034'; 6}, + sub {print '2'; 3}, + sub {print 'by'; 5}, + sub {print 'challenge'; 1}, + sub {print 'jo.'; undef}, + sub {print 'task'; 2}, + sub {print 'weekly'; 4}, + ); + + for (my $i = 0; defined $i; $i = $dispatch[$i]()) { + print ' ' if $i; + } + print "\n"; +} + -- cgit