File Coverage

blib/lib/String/Stomp.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 21 21 100.0


line stmt bran cond sub pod time code
1 1     1   61811 use 5.10.1;
  1         12  
2 1     1   5 use strict;
  1         1  
  1         18  
3 1     1   4 use warnings;
  1         1  
  1         65  
4             package String::Stomp;
5              
6             our $VERSION = '0.0103';
7             # ABSTRACT: Removes empty leading and trailing lines
8             our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
9              
10 1     1   7 use Exporter 'import';
  1         2  
  1         134  
11             our @EXPORT = qw/stomp/;
12              
13             sub stomp($) {
14 7     7 1 98 my $string = shift;
15              
16 7         57 $string =~ s{\A[\h\v]*\v(?=\h*[^\h\v])}{};
17 7         46 $string =~ s{([^\h\v]\V*)\v[\h\v]*\z}{$1};
18              
19 7         33 return $string;
20             }
21              
22             1;
23              
24             __END__