aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-078/dave-cross/perl/ch-2.pl5
1 files changed, 1 insertions, 4 deletions
diff --git a/challenge-078/dave-cross/perl/ch-2.pl b/challenge-078/dave-cross/perl/ch-2.pl
index 601ddd9520..47c45d8708 100644
--- a/challenge-078/dave-cross/perl/ch-2.pl
+++ b/challenge-078/dave-cross/perl/ch-2.pl
@@ -8,10 +8,7 @@ my ($array, $idx) = @ARGV;
my @array = split /,/, $array;
my @idx = split /,/, $idx;
-for (@idx) {
- my @rotated = rotate($_, @array);
- say '[', join(', ', @rotated), ']';
-}
+say '[', join(', ', rotate($_, @array)), ']' for @idx;
sub rotate {
my ($idx, @array) = @_;