summaryrefslogtreecommitdiff
path: root/020
diff options
context:
space:
mode:
authorGuillermo Ramos2019-08-06 15:39:56 +0200
committerGuillermo Ramos2019-08-06 15:44:10 +0200
commitf5ee0bc200f9f75654124b57c352fe5c965c122a (patch)
tree1aaf1d1b40bcf265ee47fc656ca5a2df6353f26f /020
parentda559bb53d8c4d3b46bb7c9f8679f00b9b529c6f (diff)
downloadperlweekly-f5ee0bc200f9f75654124b57c352fe5c965c122a.tar.gz
[020#1] MAXIMUM TRIMMING
Diffstat (limited to '020')
-rwxr-xr-x020/ch1.pl4
1 files changed, 1 insertions, 3 deletions
diff --git a/020/ch1.pl b/020/ch1.pl
index 0240d6a..8022fb9 100755
--- a/020/ch1.pl
+++ b/020/ch1.pl
@@ -8,8 +8,6 @@
use strict;
use warnings;
-my $str = shift;
-
my @chunks;
-push @chunks, $1 while $str =~ /((.)\2*)/g;
+push @chunks, $& while $ARGV[0] =~ /(.)\1*/g;
print "@chunks\n";