aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-026/e-choroba/blog.txt1
-rwxr-xr-xchallenge-026/e-choroba/perl5/ch-1.pl4
2 files changed, 3 insertions, 2 deletions
diff --git a/challenge-026/e-choroba/blog.txt b/challenge-026/e-choroba/blog.txt
new file mode 100644
index 0000000000..0430c2f2ef
--- /dev/null
+++ b/challenge-026/e-choroba/blog.txt
@@ -0,0 +1 @@
+http://blogs.perl.org/users/e_choroba/2019/09/perl-weekly-challenge-026-stones-and-jewels-mean-of-angles.html
diff --git a/challenge-026/e-choroba/perl5/ch-1.pl b/challenge-026/e-choroba/perl5/ch-1.pl
index 221d562b1c..a09275265b 100755
--- a/challenge-026/e-choroba/perl5/ch-1.pl
+++ b/challenge-026/e-choroba/perl5/ch-1.pl
@@ -7,8 +7,8 @@ use List::Util qw{ uniq };
sub count {
my %args = @_;
my $count = 0;
- $count += () = $args{jewels} =~ /$_/g for uniq(split //, $args{stones});
- $count
+ $count += () = $args{jewels} =~ /[$args{stones}]/g;
+ return $count
}
use Test::More tests => 6;