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   37619 use 5.00503; # Universal Consensus 1998 for primetools
  12         102  
12             # use 5.008001; # Lancaster Consensus 2013 for toolchains
13              
14             $VERSION = '0.07';
15             $VERSION = $VERSION;
16              
17 12     12   59 use strict;
  12         21  
  12         371  
18 12 50   12   219 BEGIN { $INC{'warnings.pm'} = '' if $] < 5.006 }; use warnings; $^W=1;
  12     12   78  
  12         42  
  12         591  
19 12     12   6784 use UTF8::R2;
  12         89838  
  12         75  
20 12     12   5839 use IOas::SJIS2004;
  12         29654015  
  12         81  
21              
22             sub import {
23 12     12   596 no strict qw(refs);
  12         25  
  12         2498  
24 12     12   182 tie my %mb, 'UTF8::R2';
25 12         72 *{caller().'::mb'} = \%mb;
  12         87  
26 12     16   44 *{caller().'::mbeach'} = sub { UTF8::R2::split(qr//,$_[0]) };
  12         61  
  16         985  
27 12         30 *{caller().'::mbtr' } = \&UTF8::R2::tr;
  12         53  
28 12         24 *{caller().'::iolen' } = \&IOas::SJIS2004::length;
  12         38  
29 12         26 *{caller().'::iomid' } = \&IOas::SJIS2004::substr;
  12         37  
30 12         23 *{caller().'::ioget' } = \&IOas::SJIS2004::readline;
  12         39  
31 12         25 *{caller().'::ioput' } = \&IOas::SJIS2004::print;
  12         36  
32 12         22 *{caller().'::ioputf'} = \&IOas::SJIS2004::printf;
  12         41  
33 12         23 *{caller().'::iosort'} = \&IOas::SJIS2004::sort;
  12         375  
34             }
35              
36             1;
37              
38             __END__