File Coverage

blib/lib/Importer/Zim/Lexical.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 29 29 100.0


line stmt bran cond sub pod time code
1              
2             package Importer::Zim::Lexical;
3             $Importer::Zim::Lexical::VERSION = '0.8.0';
4             # ABSTRACT: Import functions as lexical subroutines
5              
6 2     2   74756 use 5.018;
  2         23  
7              
8 2     2   752 use Importer::Zim::Base 0.8.0;
  2         12152  
  2         84  
9 2     2   72 BEGIN { our @ISA = qw(Importer::Zim::Base); }
10              
11 2     2   19 use Sub::Inject 0.2.0;
  2         24  
  2         60  
12 2     2   12 use Importer::Zim::Utils 0.8.0 qw(DEBUG carp);
  2         27  
  2         10  
13              
14             sub import {
15 3     3   295 my $class = shift;
16              
17 3         6 carp "$class->import(@_)" if DEBUG;
18 3         11 my @exports = $class->_prepare_args(@_);
19              
20 3         662 @_ = map { @{$_}{qw(export code)} } @exports;
  7         10  
  7         17  
21 3         12 goto &Sub::Inject::sub_inject;
22             }
23              
24 2     2   362 no Importer::Zim::Utils qw(DEBUG carp);
  2         6  
  2         7  
25              
26             1;
27              
28             #pod =encoding utf8
29             #pod
30             #pod =head1 SYNOPSIS
31             #pod
32             #pod use Importer::Zim::Lexical 'Scalar::Util' => 'blessed';
33             #pod use Importer::Zim::Lexical 'Scalar::Util' =>
34             #pod ( 'blessed' => { -as => 'typeof' } );
35             #pod
36             #pod use Importer::Zim::Lexical 'Mango::BSON' => ':bson';
37             #pod
38             #pod use Importer::Zim::Lexical 'Foo' => { -version => '3.0' } => 'foo';
39             #pod
40             #pod use Importer::Zim::Lexical 'Krazy::Taco' => qw(tacos burritos poop);
41             #pod
42             #pod =head1 DESCRIPTION
43             #pod
44             #pod "It's... INCREDIBLE! There's stuff down here I've never even
45             #pod dreamed of! I'm gonna try to blow it up."
46             #pod – Dib
47             #pod
48             #pod This is a backend for L which gives lexical scope
49             #pod to imported subroutines.
50             #pod
51             #pod =head1 DEBUGGING
52             #pod
53             #pod You can set the C environment variable
54             #pod for get some diagnostics information printed to C.
55             #pod
56             #pod IMPORTER_ZIM_DEBUG=1
57             #pod
58             #pod =head1 SEE ALSO
59             #pod
60             #pod L
61             #pod
62             #pod =cut
63              
64             __END__