exercism-perl5

Repository for my Perl 5 Exercism exercises
git clone git://git.samirparikh.com/exercism-perl5
Log | Files | Refs

commit a96d9bbbe005722ef20e7d98d00a971b0db4d85b
parent a74ca2b53cd48af3057017a6675683b01fc49a26
Author: Samir Parikh <noreply@samirparikh.com>
Date:   Thu, 25 Nov 2021 16:32:09 +0000

modify Matrix.pm to get all tests to pass

Diffstat:
Mmatrix/Matrix.pm | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/matrix/Matrix.pm b/matrix/Matrix.pm @@ -20,7 +20,13 @@ sub row { sub column { my ($input) = @_; - return undef; + my $index = $input->{'index'}; + my @matrix = define_matrix($input->{'string'}); + my @column; + foreach my $row (@matrix) { + push @column, $row->[$index - 1]; + } + return \@column; } 1;