blib/lib/App/Greple/wordle/util.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 11 | 16 | 68.7 |
branch | 0 | 2 | 0.0 |
condition | 0 | 3 | 0.0 |
subroutine | 4 | 5 | 80.0 |
pod | 0 | 1 | 0.0 |
total | 15 | 27 | 55.5 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | |||||||
2 | use v5.14; | ||||||
3 | 1 | 1 | 11 | use warnings; | |||
1 | 3 | ||||||
4 | 1 | 1 | 4 | ||||
1 | 1 | ||||||
1 | 21 | ||||||
5 | use Data::Dumper; | ||||||
6 | 1 | 1 | 4 | ||||
1 | 2 | ||||||
1 | 38 | ||||||
7 | use Exporter 'import'; | ||||||
8 | 1 | 1 | 4 | our @EXPORT_OK = qw(uniqword); | |||
1 | 2 | ||||||
1 | 117 | ||||||
9 | |||||||
10 | state @re; | ||||||
11 | my $len = length $_[0] or die; | ||||||
12 | 0 | 0 | 0 | my $re = $re[$len] //= | |||
13 | 0 | 0 | join('', '^(.)', | ||||
14 | map { | ||||||
15 | sprintf "(%s.)", join '', map "(?!\\$_)", 1 .. $_; | ||||||
16 | } 1 .. $len - 1); | ||||||
17 | 0 | 0 | grep /^$re/i, @_; | ||||
0 | |||||||
18 | } | ||||||
19 | 0 | ||||||
20 | 1; |