line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package YVDHOVE::String; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
23609
|
use 5.008007; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
57
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
36
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
362
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# --------------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( trim |
14
|
|
|
|
|
|
|
ltrim |
15
|
|
|
|
|
|
|
rtrim) ] ); |
16
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
17
|
|
|
|
|
|
|
our @EXPORT = qw(); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '1.05'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# --------------------------------------------------------------------------------- |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Trim function removes leading and trailing whitespaces |
24
|
|
|
|
|
|
|
sub trim($) { |
25
|
1
|
|
|
1
|
1
|
5
|
my $string = shift; |
26
|
1
|
|
|
|
|
4
|
$string =~ s/^\s+//; |
27
|
1
|
|
|
|
|
3
|
$string =~ s/\s+$//; |
28
|
1
|
|
|
|
|
3
|
return $string; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Left trim function to remove leading whitespaces |
32
|
|
|
|
|
|
|
sub ltrim($) { |
33
|
1
|
|
|
1
|
1
|
10
|
my $string = shift; |
34
|
1
|
|
|
|
|
6
|
$string =~ s/^\s+//; |
35
|
1
|
|
|
|
|
3
|
return $string; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Right trim function to remove trailing whitespaces |
39
|
|
|
|
|
|
|
sub rtrim($) { |
40
|
1
|
|
|
1
|
1
|
4
|
my $string = shift; |
41
|
1
|
|
|
|
|
7
|
$string =~ s/\s+$//; |
42
|
1
|
|
|
|
|
3
|
return $string; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# --------------------------------------------------------------------------------- |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# --------------------------------------------------------------------------------- |
50
|
|
|
|
|
|
|
__END__ |