line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package devtools; |
2
|
|
|
|
|
|
|
our $VERSION='0.02'; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
62447
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
293
|
|
5
|
|
|
|
|
|
|
require Exporter; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @ISA=qw(Exporter); |
8
|
|
|
|
|
|
|
our @EXPORT=qw(printVarStructure); |
9
|
|
|
|
|
|
|
our @EXPORT_OK=qw(); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
##################################################################################### |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# printVarStructure |
14
|
|
|
|
|
|
|
# prints the whole available structure |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub printVarStructure |
17
|
|
|
|
|
|
|
{ |
18
|
0
|
|
|
0
|
0
|
|
my ($var,$indent)=@_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
0
|
0
|
|
|
|
if (not ref $var) |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
21
|
|
|
|
|
|
|
{ |
22
|
0
|
|
|
|
|
|
print " "x$indent; |
23
|
0
|
|
|
|
|
|
print "Found scalar: '$var'\n"; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
elsif ((ref $var eq 'HASH') || (scalar $var =~/HASH/)) |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
|
|
|
print " "x$indent; |
28
|
0
|
|
|
|
|
|
print "Found hash\n"; |
29
|
0
|
|
|
|
|
|
foreach my $key (keys(%{$var})) |
|
0
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
{ |
31
|
0
|
|
|
|
|
|
print " "x$indent; |
32
|
0
|
|
|
|
|
|
print "Key: '$key' start\n"; |
33
|
0
|
|
|
|
|
|
&printVarStructure($var->{$key},$indent+1); |
34
|
0
|
|
|
|
|
|
print " "x$indent; |
35
|
0
|
|
|
|
|
|
print "Key: '$key' end\n"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
elsif ((ref $var eq 'ARRAY') || (scalar $var =~ /ARRAY/)) |
39
|
|
|
|
|
|
|
{ |
40
|
0
|
|
|
|
|
|
print " "x$indent; |
41
|
0
|
|
|
|
|
|
print "Found array\n"; |
42
|
0
|
|
|
|
|
|
my $cnt=0; |
43
|
0
|
|
|
|
|
|
foreach my $val (@{$var}) |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
|
|
|
print " "x$indent; |
46
|
0
|
|
|
|
|
|
print "Value $cnt\n"; |
47
|
0
|
|
|
|
|
|
$cnt++; |
48
|
0
|
|
|
|
|
|
&printVarStructure($val,$indent+1); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else |
52
|
|
|
|
|
|
|
{ |
53
|
0
|
|
|
|
|
|
print "don't know what to do with '$var'...\n"; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
__END__ |