File Coverage

blib/lib/Text/Safer/alphanum_snake_lc.pm
Criterion Covered Total %
statement 8 12 66.6
branch n/a
condition 0 2 0.0
subroutine 3 4 75.0
pod 1 1 100.0
total 12 19 63.1


line stmt bran cond sub pod time code
1             package Text::Safer::alphanum_snake_lc;
2              
3 1     1   421972 use 5.010001;
  1         4  
4 1     1   6 use strict;
  1         3  
  1         52  
5 1     1   6 use warnings;
  1         8  
  1         241  
6              
7             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
8             our $DATE = '2025-06-14'; # DATE
9             our $DIST = 'Text-Safer'; # DIST
10             our $VERSION = '0.003'; # VERSION
11              
12             our %META = (
13             summary => 'Like alphanum_snake, but additionally lower case',
14             args => {
15             },
16             );
17              
18             sub encode_safer {
19 0     0 1   my ($text, $args) = @_;
20 0   0       $args //= {};
21              
22 0           $text =~ s/[^A-Za-z0-9]+/_/g;
23 0           lc $text;
24             }
25              
26             1;
27             # ABSTRACT: Like alphanum_snake, but additionally lower case
28              
29             __END__