aboutsummaryrefslogtreecommitdiff
path: root/challenge-110/wlmb/perl/ch-2.pl
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-110/wlmb/perl/ch-2.pl')
-rwxr-xr-xchallenge-110/wlmb/perl/ch-2.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/challenge-110/wlmb/perl/ch-2.pl b/challenge-110/wlmb/perl/ch-2.pl
new file mode 100755
index 0000000000..d9eca28023
--- /dev/null
+++ b/challenge-110/wlmb/perl/ch-2.pl
@@ -0,0 +1,11 @@
+#!/usr/bin/env perl
+# Perl weekly challenge 110
+# Task 2: Transpose file
+#
+# Simple version
+# See https://wlmb.github.io/2021/04/27/PWC110/#task-2-transpose-file
+use strict;
+use warnings;
+use v5.12;
+my @input=map {chomp; [split /,/]} <>;
+say join "\n", map { my $c=$_; join ",", map {$input[$_][$c]} 0..@input-1} 0..scalar @{$input[0]}-1;