File Coverage

blib/lib/Encode/Punycode.pm
Criterion Covered Total %
statement 23 25 92.0
branch 2 4 50.0
condition n/a
subroutine 7 9 77.7
pod 4 4 100.0
total 36 42 85.7


line stmt bran cond sub pod time code
1             package Encode::Punycode;
2              
3 2     2   45722 use strict;
  2         5  
  2         78  
4 2     2   1083 use utf8;
  2         62  
  2         13  
5 2     2   69 use warnings;
  2         5  
  2         145  
6              
7             our $VERSION = '1.001';
8             $VERSION = eval $VERSION;
9              
10             require Encode;
11 2     2   12 use base qw(Encode::Encoding);
  2         5  
  2         1033  
12             __PACKAGE__->Define('Punycode', 'punycode');
13              
14 2     2   14435 use Net::IDN::Punycode();
  2         17405  
  2         367  
15              
16             sub encode {
17 20     20 1 11384 my($self, $string, $check) = @_;
18 20         294 $string = Net::IDN::Punycode::encode_punycode($string);
19 20 50       45 $_[1] = '' if $check;
20 20         57 return $string;
21             }
22              
23             sub decode {
24 20     20 1 10770 my($self, $string, $check) = @_;
25 20         139 $string = Net::IDN::Punycode::decode_punycode($string);
26 20 50       48 $_[1] = '' if $check;
27 20         55 return $string;
28             }
29              
30             sub mime_name {
31 0     0 1   return undef;
32             };
33              
34             sub perlio_ok {
35 0     0 1   return 0;
36             }
37              
38             1;
39             __END__