aboutsummaryrefslogtreecommitdiff
path: root/challenge-040
diff options
context:
space:
mode:
authorAnton <tosha.fedotov.2000@gmail.com>2019-12-26 16:07:11 +0500
committerAnton <tosha.fedotov.2000@gmail.com>2019-12-26 16:11:43 +0500
commit50b02089df78a60791daef6e23a1ae0cfc004651 (patch)
tree4dceb0b304df4f3ac8e63dd8c5f0f4d3fd134f91 /challenge-040
parent8197e767f4477a114b1a25e77cb277d58c621102 (diff)
downloadperlweeklychallenge-club-50b02089df78a60791daef6e23a1ae0cfc004651.tar.gz
perlweeklychallenge-club-50b02089df78a60791daef6e23a1ae0cfc004651.tar.bz2
perlweeklychallenge-club-50b02089df78a60791daef6e23a1ae0cfc004651.zip
ch-1 added
Diffstat (limited to 'challenge-040')
-rwxr-xr-xchallenge-040/anton-fedotov/perl5/ch-1.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/challenge-040/anton-fedotov/perl5/ch-1.pl b/challenge-040/anton-fedotov/perl5/ch-1.pl
new file mode 100755
index 0000000000..e5849eeb51
--- /dev/null
+++ b/challenge-040/anton-fedotov/perl5/ch-1.pl
@@ -0,0 +1,32 @@
+#!/usr/bin/env perl
+
+##################################################
+# Perl Weekle Challenge 040 -> Chapter 1 #
+##################################################
+
+use v5.10;
+use strict;
+use warnings;
+
+my @arr1 = qw( I L O V E Y O U );
+my @arr2 = qw( T Z U Y U F R O M);
+my @arr3 = qw( T W I C E );
+my @arr4 = qw( ! ? £ $ % ^ & * );
+
+&print_arrays(\@arr1, \@arr2, \@arr3, \@arr4);
+
+sub print_arrays {
+ my $max_size = 0;
+ for (@_) {
+ my $size = scalar @$_;
+ $max_size = $size if $size > $max_size;
+ }
+
+ for my $i (0 .. $max_size) {
+ for (@_) {
+ if ($_->[$i]) { print $_->[$i] . ' ' }
+ else { print ' ' };
+ }
+ print "\n";
+ }
+}