aboutsummaryrefslogtreecommitdiff
path: root/challenge-040/duane-powell/perl5/ch-1.pl
blob: e625dec0298fc30d79baea516d53793afe34c138 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/perl
use warnings;
use strict;
use feature qw( say );

my $AoA = [
	[qw( I L O V E Y O U !)],
	[qw( 2 4 0 3 2 0 1 9)],
	[qw( ! ? $ $ % ^ & * @ + -)],
];

my $max = 0;
foreach my $aref ( @{$AoA} ) {
	$max = (scalar(@{$aref}) > $max) ? scalar(@{$aref}) : $max;
}

foreach my $i (0 .. $max-1) {
	my $out;
	foreach my $aref ( @{$AoA} ) {
		$out .= defined($aref->[$i]) ? $aref->[$i] : " ";
	}
	say $out;
}

__END__

./ch-1.pl
I2!
L4?
O0$
V3$
E2%
Y0^
O1&
U9*
! @
  +
  -