blib/lib/String/Stomp.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 2 ▶use 5.10.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 package String::Stomp;
5  
6 2 our $VERSION = '0.0103';
7 # ABSTRACT: Removes empty leading and trailing lines
8 2 our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
9  
10 2 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 our @EXPORT = qw/stomp/;
12  
13 7 ▶sub stomp($) {
Subroutine stomp: called CC=1 SCAR=0.0
Pod documented
14 7 my $string = shift;
15  
16 7 $string =~ s{\A[\h\v]*\v(?=\h*[^\h\v])}{};
17 7 $string =~ s{([^\h\v]\V*)\v[\h\v]*\z}{$1};
18  
19 7 return $string;
20 }
21  
22 2 1;
23  
24 __END__
↑ Summary