File Coverage

lib/SJIS2004/R2.pm
Criterion Covered Total %
statement 38 38 100.0
branch 1 2 50.0
condition n/a
subroutine 9 9 100.0
pod n/a
total 48 49 97.9


line stmt bran cond sub pod time code
1             package SJIS2004::R2;
2             ######################################################################
3             #
4             # SJIS2004::R2 - provides minimal SJIS2004 I/O subroutines by short name
5             #
6             # http://search.cpan.org/dist/SJIS2004-R2/
7             #
8             # Copyright (c) 2019, 2021 INABA Hitoshi in a CPAN
9             ######################################################################
10              
11 12     12   35369 use 5.00503; # Universal Consensus 1998 for primetools
  12         92  
12             # use 5.008001; # Lancaster Consensus 2013 for toolchains
13              
14             $VERSION = '0.06';
15             $VERSION = $VERSION;
16              
17 12     12   64 use strict;
  12         23  
  12         348  
18 12 50   12   199 BEGIN { $INC{'warnings.pm'} = '' if $] < 5.006 }; use warnings; $^W=1;
  12     12   74  
  12         34  
  12         772  
19 12     12   6049 use UTF8::R2;
  12         83886  
  12         66  
20 12     12   5148 use IOas::SJIS2004;
  12         28615512  
  12         105  
21              
22             sub import {
23 12     12   586 no strict qw(refs);
  12         24  
  12         2144  
24 12     12   174 tie my %mb, 'UTF8::R2';
25 12         70 *{caller().'::mb'} = \%mb;
  12         81  
26 12     16   44 *{caller().'::mbeach'} = sub { UTF8::R2::split(qr//,$_[0]) };
  12         63  
  16         974  
27 12         27 *{caller().'::mbtr' } = \&UTF8::R2::tr;
  12         48  
28 12         22 *{caller().'::iolen' } = \&IOas::SJIS2004::length;
  12         40  
29 12         24 *{caller().'::iomid' } = \&IOas::SJIS2004::substr;
  12         37  
30 12         22 *{caller().'::ioget' } = \&IOas::SJIS2004::readline;
  12         37  
31 12         21 *{caller().'::ioput' } = \&IOas::SJIS2004::print;
  12         36  
32 12         21 *{caller().'::ioputf'} = \&IOas::SJIS2004::printf;
  12         41  
33 12         22 *{caller().'::iosort'} = \&IOas::SJIS2004::sort;
  12         348  
34             }
35              
36             1;
37              
38             __END__