line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Stream::Tools; |
2
|
12
|
|
|
12
|
|
59
|
use strict; |
|
12
|
|
|
|
|
21
|
|
|
12
|
|
|
|
|
435
|
|
3
|
12
|
|
|
12
|
|
58
|
use warnings; |
|
12
|
|
|
|
|
17
|
|
|
12
|
|
|
|
|
316
|
|
4
|
|
|
|
|
|
|
|
5
|
12
|
|
|
12
|
|
57
|
use FileHandle; |
|
12
|
|
|
|
|
17
|
|
|
12
|
|
|
|
|
89
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# helper function (not a method!) |
8
|
|
|
|
|
|
|
sub setup_debug { |
9
|
20
|
|
|
20
|
0
|
66
|
my ($self, %args) = @_; |
10
|
|
|
|
|
|
|
|
11
|
20
|
|
|
|
|
52
|
$self->{DEBUGTIME} = 0; |
12
|
20
|
100
|
|
|
|
68
|
$self->{DEBUGTIME} = $args{debugtime} if exists($args{debugtime}); |
13
|
|
|
|
|
|
|
|
14
|
20
|
|
|
|
|
53
|
$self->{DEBUGLEVEL} = 0; |
15
|
20
|
100
|
|
|
|
68
|
$self->{DEBUGLEVEL} = $args{debuglevel} if exists($args{debuglevel}); |
16
|
|
|
|
|
|
|
|
17
|
20
|
|
|
|
|
53
|
$self->{DEBUGFILE} = ""; |
18
|
|
|
|
|
|
|
|
19
|
20
|
|
50
|
|
|
113
|
$args{debugfh} ||= ''; |
20
|
20
|
|
100
|
|
|
135
|
$args{debug} ||= ''; |
21
|
|
|
|
|
|
|
|
22
|
20
|
50
|
|
|
|
151
|
if ($args{debugfh} ne "") |
|
|
100
|
|
|
|
|
|
23
|
|
|
|
|
|
|
{ |
24
|
0
|
|
|
|
|
0
|
$self->{DEBUGFILE} = $args{debugfh}; |
25
|
0
|
|
|
|
|
0
|
$self->{DEBUG} = 1; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
elsif ($args{debug} ne "") |
28
|
|
|
|
|
|
|
{ |
29
|
2
|
|
|
|
|
5
|
$self->{DEBUG} = 1; |
30
|
2
|
50
|
|
|
|
6
|
if (lc($args{debug}) eq "stdout") |
31
|
|
|
|
|
|
|
{ |
32
|
2
|
|
|
|
|
16
|
$self->{DEBUGFILE} = FileHandle->new(">&STDERR"); |
33
|
2
|
|
|
|
|
139
|
$self->{DEBUGFILE}->autoflush(1); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
else |
36
|
|
|
|
|
|
|
{ |
37
|
0
|
0
|
|
|
|
|
if (-e $args{debug}) |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
0
|
|
|
|
|
if (-w $args{debug}) |
40
|
|
|
|
|
|
|
{ |
41
|
0
|
|
|
|
|
|
$self->{DEBUGFILE} = FileHandle->new(">$args{debug}"); |
42
|
0
|
|
|
|
|
|
$self->{DEBUGFILE}->autoflush(1); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
else |
45
|
|
|
|
|
|
|
{ |
46
|
0
|
|
|
|
|
|
print "WARNING: debug file ($args{debug}) is not writable by you\n"; |
47
|
0
|
|
|
|
|
|
print " No debug information being saved.\n"; |
48
|
0
|
|
|
|
|
|
$self->{DEBUG} = 0; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else |
52
|
|
|
|
|
|
|
{ |
53
|
0
|
|
|
|
|
|
$self->{DEBUGFILE} = FileHandle->new(">$args{debug}"); |
54
|
0
|
0
|
|
|
|
|
if (defined($self->{DEBUGFILE})) |
55
|
|
|
|
|
|
|
{ |
56
|
0
|
|
|
|
|
|
$self->{DEBUGFILE}->autoflush(1); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
else |
59
|
|
|
|
|
|
|
{ |
60
|
0
|
|
|
|
|
|
print "WARNING: debug file ($args{debug}) does not exist \n"; |
61
|
0
|
|
|
|
|
|
print " and is not writable by you.\n"; |
62
|
0
|
|
|
|
|
|
print " No debug information being saved.\n"; |
63
|
0
|
|
|
|
|
|
$self->{DEBUG} = 0; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|