Flute/Filter/Strip.pm untested

filter: Statementstmt 0.0% 0 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 18 CC 1 SCAR 6.9
CC
1
Cov
0%
filter
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Template::Flute::Filter::Strip;
2  
3 use strict;
4 use warnings;
5  
6 use base 'Template::Flute::Filter';
7  
8 =head1 NAME
9  
10 Template::Flute::Filter::Strip - Strip filter
11  
12 =head1 DESCRIPTION
13  
14 This filter strips whitespace from the beginning and
15 the end of a string.
16  
17 =head1 METHODS
18  
19 =head2 filter
20  
21 Strips leading and trailing whitespace.
22  
23 =cut
24  
25 sub filter {
26 my ($self, $value) = @_;
27  
28 $value =~ s/^\s+//;
29 $value =~ s/\s+$//;
30  
31 return $value;
32 }
33  
34 =head1 AUTHOR
35  
36 Stefan Hornburg (Racke), <racke@linuxia.de>
37  
38 =head1 LICENSE AND COPYRIGHT
39  
40 Copyright 2013-2016 Stefan Hornburg (Racke) <racke@linuxia.de>.
41  
42 This program is free software; you can redistribute it and/or modify it
43 under the terms of either: the GNU General Public License as published
44 by the Free Software Foundation; or the Artistic License.
45  
46 See http://dev.perl.org/licenses/ for more information.
47  
48 =cut
49  
50 1;