| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package XML::MyXML::Util; |
|
2
|
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
61
|
use strict; |
|
|
5
|
|
|
|
|
8
|
|
|
|
5
|
|
|
|
|
188
|
|
|
4
|
5
|
|
|
5
|
|
32
|
use warnings; |
|
|
5
|
|
|
|
|
24
|
|
|
|
5
|
|
|
|
|
2025
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Exporter; |
|
7
|
|
|
|
|
|
|
our @ISA = ('Exporter'); |
|
8
|
|
|
|
|
|
|
our @EXPORT_OK = qw/ trim strip_ns debug /; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = "1.09"; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub trim { |
|
13
|
2
|
|
|
2
|
0
|
3
|
my $string = shift; |
|
14
|
|
|
|
|
|
|
|
|
15
|
2
|
50
|
|
|
|
4
|
if (defined $string) { |
|
16
|
2
|
|
|
|
|
5
|
$string =~ s/^\s+//; |
|
17
|
2
|
|
|
|
|
5
|
$string =~ s/\s+$//; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
2
|
|
|
|
|
4
|
return $string; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub strip_ns { |
|
24
|
3
|
|
|
3
|
0
|
6
|
my $string = shift; |
|
25
|
|
|
|
|
|
|
|
|
26
|
3
|
50
|
|
|
|
6
|
defined $string or return undef; |
|
27
|
|
|
|
|
|
|
|
|
28
|
3
|
|
|
|
|
11
|
my $num_colons = () = $string =~ /\:/g; |
|
29
|
3
|
100
|
66
|
|
|
24
|
if ($num_colons == 1 and $string =~ /.\:./) { |
|
30
|
2
|
|
|
|
|
11
|
$string =~ s/^.+\://; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
3
|
|
|
|
|
8
|
return $string; |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub debug { |
|
37
|
0
|
|
|
0
|
0
|
|
my $thing = shift; |
|
38
|
0
|
|
|
|
|
|
require Data::Dumper; |
|
39
|
0
|
0
|
|
|
|
|
warn Data::Dumper::Dumper($thing) if $ENV{DEBUG}; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |