line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Stream::Tools; |
2
|
12
|
|
|
12
|
|
55
|
use strict; |
|
12
|
|
|
|
|
15
|
|
|
12
|
|
|
|
|
393
|
|
3
|
12
|
|
|
12
|
|
48
|
use warnings; |
|
12
|
|
|
|
|
18
|
|
|
12
|
|
|
|
|
264
|
|
4
|
|
|
|
|
|
|
|
5
|
12
|
|
|
12
|
|
47
|
use FileHandle; |
|
12
|
|
|
|
|
17
|
|
|
12
|
|
|
|
|
75
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# helper function (not a method!) |
8
|
|
|
|
|
|
|
sub setup_debug { |
9
|
20
|
|
|
20
|
0
|
64
|
my ($self, %args) = @_; |
10
|
|
|
|
|
|
|
|
11
|
20
|
|
|
|
|
44
|
$self->{DEBUGTIME} = 0; |
12
|
20
|
100
|
|
|
|
64
|
$self->{DEBUGTIME} = $args{debugtime} if exists($args{debugtime}); |
13
|
|
|
|
|
|
|
|
14
|
20
|
|
|
|
|
50
|
$self->{DEBUGLEVEL} = 0; |
15
|
20
|
100
|
|
|
|
63
|
$self->{DEBUGLEVEL} = $args{debuglevel} if exists($args{debuglevel}); |
16
|
|
|
|
|
|
|
|
17
|
20
|
|
|
|
|
57
|
$self->{DEBUGFILE} = ""; |
18
|
|
|
|
|
|
|
|
19
|
20
|
|
50
|
|
|
271
|
$args{debugfh} ||= ''; |
20
|
20
|
|
100
|
|
|
102
|
$args{debug} ||= ''; |
21
|
|
|
|
|
|
|
|
22
|
20
|
50
|
|
|
|
141
|
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
|
|
|
|
8
|
if (lc($args{debug}) eq "stdout") |
31
|
|
|
|
|
|
|
{ |
32
|
2
|
|
|
|
|
22
|
$self->{DEBUGFILE} = FileHandle->new(">&STDERR"); |
33
|
2
|
|
|
|
|
176
|
$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
|
|
|
|
|
|
|
|