File Coverage

blib/lib/Syntax/Infix/Smartmatch.pm
Criterion Covered Total %
statement 12 14 85.7
branch 1 2 50.0
condition n/a
subroutine 4 5 80.0
pod n/a
total 17 21 80.9


line stmt bran cond sub pod time code
1             package Syntax::Infix::Smartmatch;
2             $Syntax::Infix::Smartmatch::VERSION = '0.003';
3 1     1   101851 use strict;
  1         3  
  1         29  
4 1     1   5 use warnings;
  1         4  
  1         26  
5              
6 1     1   5 use XSLoader;
  1         2  
  1         201  
7              
8             XSLoader::load(__PACKAGE__, __PACKAGE__->VERSION);
9              
10             my $warning = $] >= 5.038 ? 'deprecated::smartmatch' : $] >= 5.018 ? 'experimental::smartmatch' : undef;
11              
12             sub import {
13 1     1   7 $^H |= 0x020000;
14 1         5 $^H{"Syntax::Infix::Smartmatch/enabled"} = 1;
15 1 50       1671 warnings->unimport($warning) if defined $warning;
16             }
17              
18             sub unimport {
19 0     0     $^H |= 0x020000;
20 0           delete $^H{"Syntax::Infix::Smartmatch/enabled"};
21             }
22              
23             1;
24              
25             # ABSTRACT: Smartmatch done right
26              
27             __END__