File Coverage

blib/lib/bareword/filehandles.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 28 28 100.0


line stmt bran cond sub pod time code
1             package bareword::filehandles;
2             # ABSTRACT: disables bareword filehandles
3             $bareword::filehandles::VERSION = '0.005';
4 1     1   13625 { use 5.008001; }
  1         2  
5 1     1   4 use strict;
  1         1  
  1         22  
6 1     1   2 use warnings;
  1         1  
  1         29  
7              
8 1     1   407 use Lexical::SealRequireHints;
  1         516  
  1         4  
9 1     1   376 use B::Hooks::OP::Check;
  1         1048  
  1         24  
10 1     1   5 use XSLoader;
  1         1  
  1         81  
11              
12             XSLoader::load(
13             __PACKAGE__,
14             # we need to be careful not to touch $VERSION at compile time, otherwise
15             # DynaLoader will assume it's set and check against it, which will cause
16             # fail when being run in the checkout without dzil having set the actual
17             # $VERSION
18             exists $bareword::filehandles::{VERSION} ? ${ $bareword::filehandles::{VERSION} } : (),
19             );
20              
21              
22 479     479   158834 sub unimport { $^H |= 0x20000; $^H{__PACKAGE__.'/disabled'} = 1 }
  479         17142  
23              
24              
25 1     1   18 sub import { delete $^H{__PACKAGE__.'/disabled'} }
26              
27              
28             1;
29              
30             __END__