File Coverage

blib/lib/XML/Tiny/Simple.pm
Criterion Covered Total %
statement 42 50 84.0
branch 14 24 58.3
condition n/a
subroutine 7 7 100.0
pod 3 3 100.0
total 66 84 78.5


line stmt bran cond sub pod time code
1             package XML::Tiny::Simple;
2 2     2   50445 use Exporter 'import';
  2         6  
  2         96  
3             @EXPORT_OK = qw( parsefile parsestring );
4 2     2   12 use strict;
  2         6  
  2         73  
5 2     2   10 use warnings;
  2         21  
  2         100  
6            
7             =head1 NAME
8            
9             XML::Tiny::Simple - a tiny helper to read XML::Tiny output and transform it
10             to something like XML::Simple, but without dependencies.
11            
12             =head1 VERSION
13            
14             Version 0.01
15            
16             =cut
17            
18             our $VERSION = '0.01';
19 2     2   1850 use XML::Tiny;
  2         4154  
  2         1120  
20            
21             =head1 SYNOPSIS
22            
23            
24             use XML::Tiny::Simple qw(parsestring);
25            
26             my $doc = parsestring( *DATA );
27            
28             $doc->{root}->{branch}->{second}->{leaf}->[0]->{flower}; # "false"
29             $doc->{root}->{branch}->{second}->{leaf}->[0]->{content}; #"a dead leaf"
30             $doc->{root}->{branch}->{first}->{name}; "first"
31             $doc->{root}->{branch}->{first}->{tag}; "branch"
32             __DATA__