aboutsummaryrefslogtreecommitdiff
path: root/challenge-280
diff options
context:
space:
mode:
authorKjetilS <kjetilskotheim@gmail.com>2024-08-06 01:35:25 +0200
committerKjetilS <kjetilskotheim@gmail.com>2024-08-06 01:35:25 +0200
commit39c5867315fd94c62bdf0bef5767247348b1781e (patch)
tree047db2c11e4d90f7ec22685d32bd05c48b040b4e /challenge-280
parentb029a5cccde12c8c49738508cfa0d003e5856adc (diff)
downloadperlweeklychallenge-club-39c5867315fd94c62bdf0bef5767247348b1781e.tar.gz
perlweeklychallenge-club-39c5867315fd94c62bdf0bef5767247348b1781e.tar.bz2
perlweeklychallenge-club-39c5867315fd94c62bdf0bef5767247348b1781e.zip
improvement of last weeks answer, uncomplicate it
Diffstat (limited to 'challenge-280')
-rw-r--r--challenge-280/kjetillll/perl/ch-2.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/challenge-280/kjetillll/perl/ch-2.pl b/challenge-280/kjetillll/perl/ch-2.pl
index 904a03eb3f..afc5b87f93 100644
--- a/challenge-280/kjetillll/perl/ch-2.pl
+++ b/challenge-280/kjetillll/perl/ch-2.pl
@@ -2,7 +2,8 @@ use strict; use warnings; use Test::More tests=>3;
sub count {
local $_ = shift;
- s/ \| .*? \| //x ? count($_) : y/*//
+ s/ \| .*? \| //xg;
+ y/*//
}
is count( $$_{input} ) => $$_{output}