line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormFu::Filter::TrimEdges; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
461
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
192
|
|
4
|
|
|
|
|
|
|
our $VERSION = '2.05'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
11
|
use Moose; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
11
|
|
7
|
|
|
|
|
|
|
extends 'HTML::FormFu::Filter'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub filter { |
10
|
1
|
|
|
1
|
0
|
0
|
my ( $self, $value ) = @_; |
11
|
|
|
|
|
|
|
|
12
|
1
|
50
|
|
|
|
3
|
return if !defined $value; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
4
|
$value =~ s/^\s+//; |
15
|
1
|
|
|
|
|
4
|
$value =~ s/\s+\z//; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
2
|
return $value; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__END__ |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 NAME |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
HTML::FormFu::Filter::TrimEdges - filter trimming whitespace |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 VERSION |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
version 2.05 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 DESCRIPTION |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Trim whitespaces from beginning and end of string. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 AUTHOR |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Mario Minati, C<mario@minati.de> |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Based on the original source code of L<HTML::Widget::Filter::TrimEdges>, by |
43
|
|
|
|
|
|
|
Sebastian Riedel, C<sri@oook.de> |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 LICENSE |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it |
48
|
|
|
|
|
|
|
under |
49
|
|
|
|
|
|
|
the same terms as Perl itself. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |