File Coverage

lib/XML/Parser/Style/EasyTree.pm
Criterion Covered Total %
statement 24 28 85.7
branch 2 4 50.0
condition n/a
subroutine 5 5 100.0
pod n/a
total 31 37 83.7


line stmt bran cond sub pod time code
1             package XML::Parser::Style::EasyTree;
2              
3 1     1   37194 use strict;
  1         2  
  1         33  
4 1     1   7 use warnings;
  1         1  
  1         29  
5 1     1   5 use Scalar::Util ();
  1         6  
  1         15  
6 1     1   5 no strict;
  1         1  
  1         196  
7              
8             =head1 NAME
9              
10             XML::Parser::Style::EasyTree - Parse xml to simple tree
11              
12             =head1 VERSION
13              
14             Version 0.08
15              
16             =cut
17              
18              
19              
20             =head1 PLEASE USE ETREE
21              
22             This module intersects with L (I didn't found it before commit because of missing '::Style' in it's name)
23              
24             But since we are using same style name, we're mutual exclusive ;(
25              
26             It is leaved as a compatibility wrapper to L (If you use it, all your code will keep working)
27              
28             L is included in this distribution
29              
30             But I recommend to use C instead
31              
32             All documentation look in L
33              
34             =cut
35              
36             BEGIN{
37 1     1   2 for(qw(TEXT FORCE_ARRAY FORCE_HASH)) {
38 3 50       15 if (defined *$_{HASH}) {
39             #warn "have own $_";
40 0         0 *{'XML::Parser::Style::ETree::'.$_} = \%$_;
  0         0  
41             } else {
42             #warn "use foreign $_";
43 3         10 *$_ = \%{'XML::Parser::Style::ETree::'.$_};
  3         17  
44             }
45             }
46 1         3 for(qw(STRIP_KEY)) {
47 1 50       6 if (defined *$_{ARRAY}) {
48             #warn "have own $_";
49 0         0 *{'XML::Parser::Style::ETree::'.$_} = \@$_;
  0         0  
50             } else {
51             #warn "use foreign $_";
52 1         2 *$_ = \%{'XML::Parser::Style::ETree::'.$_};
  1         17  
53             }
54             }
55 1         602 require XML::Parser::Style::ETree;
56 1         12 $VERSION = $XML::Parser::Style::ETree::VERSION;
57 5         53 *$_ = \&{'XML::Parser::Style::ETree::'.$_}
58 1         3 for qw(Init Start End Char Final);
59             }
60              
61             =head1 AUTHOR
62              
63             Mons Anderson,
64              
65             =head1 BUGS
66              
67             None known
68              
69             =head1 COPYRIGHT & LICENSE
70              
71             Copyright 2009 Mons Anderson
72              
73             This program is free software; you can redistribute it and/or modify it
74             under the same terms as Perl itself.
75              
76             =cut
77              
78             1;