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.006';
4 1     1   62482 { use 5.008001; }
  1         11  
5 1     1   18 use strict;
  1         2  
  1         23  
6 1     1   4 use warnings;
  1         1  
  1         47  
7              
8 1     1   594 use if "$]" < 5.012, 'Lexical::SealRequireHints';
  1         18  
  1         8  
9 1     1   422 use B::Hooks::OP::Check;
  1         1187  
  1         27  
10 1     1   7 use XSLoader;
  1         1  
  1         103  
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   305291 sub unimport { $^H |= 0x20000; $^H{__PACKAGE__.'/disabled'} = 1 }
  479         20206  
23              
24              
25 1     1   21 sub import { delete $^H{__PACKAGE__.'/disabled'} }
26              
27              
28             1;
29              
30             __END__