line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package String::Trim::Regex; |
2
|
|
|
|
|
|
|
our $VERSION = 20210604; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
71963
|
use warnings FATAL => qw(all); |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
40
|
|
5
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
6
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
151
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=pod |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Trims the spaces off the leading / trailing string. |
11
|
|
|
|
|
|
|
This is my first module. Be kind. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub trim($) |
16
|
|
|
|
|
|
|
{ |
17
|
3
|
|
|
3
|
0
|
1121
|
my $string = shift; |
18
|
|
|
|
|
|
|
|
19
|
3
|
100
|
|
|
|
8
|
unless (defined $string) |
20
|
|
|
|
|
|
|
{ |
21
|
1
|
|
|
|
|
235
|
confess qq[String needs to be defined.\n]; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
15
|
$string =~ s~^\s+|\s+$~~g; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
10
|
$string |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
1
|
|
7
|
use Exporter qw(import); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
62
|
|
31
|
1
|
|
|
1
|
|
6
|
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
127
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
34
|
|
|
|
|
|
|
@EXPORT = qw(); |
35
|
|
|
|
|
|
|
@EXPORT_OK = qw(trim); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
%EXPORT_TAGS = (all=>[@EXPORT, @EXPORT_OK]); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |