File Coverage

lib/MKDoc/XML/Decode/Numeric.pm
Criterion Covered Total %
statement 6 14 42.8
branch 0 6 0.0
condition n/a
subroutine 2 3 66.6
pod 0 1 0.0
total 8 24 33.3


line stmt bran cond sub pod time code
1             package MKDoc::XML::Decode::Numeric;
2 7     7   38 use warnings;
  7         10  
  7         286  
3 7     7   36 use strict;
  7         12  
  7         1335  
4              
5             sub process
6             {
7 0 0   0 0   (@_ == 2) or warn "MKDoc::XML::Encode::process() should be called with two arguments";
8            
9 0           my $class = shift;
10            
11 0           my $stuff = shift;
12 0 0         $stuff =~ s/^#// or return;
13            
14             # if hex, convert to hex
15 0           $stuff =~ s/^\[xX]([0-9a-fA-F])+$/hex($1)/e;
  0            
16            
17 0 0         return unless ($stuff =~ /^\d+$/);
18 0           return chr ($stuff);
19             }
20              
21             1;
22              
23             __END__