| 1 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | |||||||||||
| 3 | package HTML::FormFu::Filter::TrimEdges; | ||||||||||
| 4 | 2 | $HTML::FormFu::Filter::TrimEdges::VERSION = '2.06'; | |||||||||
| 5 | # ABSTRACT: filter trimming whitespace | ||||||||||
| 6 | |||||||||||
| 7 | 2 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | extends 'HTML::FormFu::Filter'; | |||||||||
| 9 | |||||||||||
| 10 | sub filter { | ||||||||||
| 11 | 1 | ▶ | my ( $self, $value ) = @_; | ||||||||
|
Subroutine
filter: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | return if !defined $value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | $value =~ s/^\s+//; | |||||||||
| 16 | 1 | $value =~ s/\s+\z//; | |||||||||
| 17 | |||||||||||
| 18 | 1 | return $value; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||
| 22 | |||||||||||
| 23 | 2 | 1; | |||||||||
| 24 | |||||||||||
| 25 | __END__ | ||||||||||
| 26 | |||||||||||
| 27 | =pod | ||||||||||
| 28 | |||||||||||
| 29 | =encoding UTF-8 | ||||||||||
| 30 | |||||||||||
| 31 | =head1 NAME | ||||||||||
| 32 | |||||||||||
| 33 | HTML::FormFu::Filter::TrimEdges - filter trimming whitespace | ||||||||||
| 34 | |||||||||||
| 35 | =head1 VERSION | ||||||||||
| 36 | |||||||||||
| 37 | version 2.06 | ||||||||||
| 38 | |||||||||||
| 39 | =head1 DESCRIPTION | ||||||||||
| 40 | |||||||||||
| 41 | Trim whitespaces from beginning and end of string. | ||||||||||
| 42 | |||||||||||
| 43 | =head1 AUTHOR | ||||||||||
| 44 | |||||||||||
| 45 | Mario Minati, C<mario@minati.de> | ||||||||||
| 46 | |||||||||||
| 47 | Based on the original source code of L<HTML::Widget::Filter::TrimEdges>, by | ||||||||||
| 48 | Sebastian Riedel, C<sri@oook.de> | ||||||||||
| 49 | |||||||||||
| 50 | =head1 LICENSE | ||||||||||
| 51 | |||||||||||
| 52 | This library is free software, you can redistribute it and/or modify it | ||||||||||
| 53 | under | ||||||||||
| 54 | the same terms as Perl itself. | ||||||||||
| 55 | |||||||||||
| 56 | =head1 AUTHOR | ||||||||||
| 57 | |||||||||||
| 58 | Carl Franks <cpan@fireartist.com> | ||||||||||
| 59 | |||||||||||
| 60 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 61 | |||||||||||
| 62 | This software is copyright (c) 2018 by Carl Franks. | ||||||||||
| 63 | |||||||||||
| 64 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 65 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 66 | |||||||||||
| 67 | =cut | ||||||||||