diff options
author | Guillermo Ramos | 2019-08-06 14:41:28 +0200 |
---|---|---|
committer | Guillermo Ramos | 2019-08-06 14:41:28 +0200 |
commit | 15c6b0541a233e593b1870a188a6e06900f5e074 (patch) | |
tree | cc054fc7fead9fe88321ad1c12417f200de48c3f /020/ch1.pl | |
parent | 617e9994dae13e899c40383bbe01bd94f6514568 (diff) | |
download | perlweekly-15c6b0541a233e593b1870a188a6e06900f5e074.tar.gz |
[020#1] Second try
Diffstat (limited to '020/ch1.pl')
-rwxr-xr-x | 020/ch1.pl | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -8,6 +8,8 @@ use strict; use warnings; -use 5.13.2; +my $str = shift; -print substr(shift =~ s/((.)\g2*)/$1 /gr, 0, -1), "\n"; +my @chunks; +push @chunks, $1 while ($str =~ /\G((.)\2*)/g); +print "@chunks\n"; |