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   25520 use strict;
  2         3  
  2         46  
4 2     2   628 use utf8;
  2         9  
  2         9  
5 2     2   48 use warnings;
  2         2  
  2         103  
6              
7             our $VERSION = '1.002';
8             $VERSION = eval $VERSION;
9              
10             require Encode;
11 2     2   7 use base qw(Encode::Encoding);
  2         2  
  2         581  
12             __PACKAGE__->Define('Punycode', 'punycode');
13              
14 2     2   8296 use Net::IDN::Punycode();
  2         1177  
  2         232  
15              
16             sub encode {
17 20     20 1 4688 my($self, $string, $check) = @_;
18 20         186 $string = Net::IDN::Punycode::encode_punycode($string);
19 20 50       36 $_[1] = '' if $check;
20 20         33 return $string;
21             }
22              
23             sub decode {
24 20     20 1 4770 my($self, $string, $check) = @_;
25 20         84 $string = Net::IDN::Punycode::decode_punycode($string);
26 20 50       40 $_[1] = '' if $check;
27 20         31 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__