blib/lib/Importer/Zim/Lexical.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 31 / 31 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Build ↑ Summary
1  
2 package Importer::Zim::Lexical;
3 2 $Importer::Zim::Lexical::VERSION = '0.8.0';
4 # ABSTRACT: Import functions as lexical subroutines
5  
6 2 ▶use 5.018;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Importer::Zim::Base 0.8.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶BEGIN { our @ISA = qw(Importer::Zim::Base); }
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 ▶use Sub::Inject 0.2.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Importer::Zim::Utils 0.8.0 qw(DEBUG carp);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 sub import {
15 3 ▶ my $class = shift;
Subroutine import: called CC=1 SCAR=0.0
16  
17 3 carp "$class->import(@_)" if DEBUG;
18 3 my @exports = $class->_prepare_args(@_);
19  
20 3 @_ = map { @{$_}{qw(export code)} } @exports;
21 3 goto &Sub::Inject::sub_inject;
22 }
23  
24 2 ▶no Importer::Zim::Utils qw(DEBUG carp);
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 2 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<Importer::Zim> which gives lexical scope
49 #pod to imported subroutines.
50 #pod
51 #pod =head1 DEBUGGING
52 #pod
53 #pod You can set the C<IMPORTER_ZIM_DEBUG> environment variable
54 #pod for get some diagnostics information printed to C<STDERR>.
55 #pod
56 #pod IMPORTER_ZIM_DEBUG=1
57 #pod
58 #pod =head1 SEE ALSO
59 #pod
60 #pod L<Importer::Zim>
61 #pod
62 #pod =cut
63  
64 __END__
« Build ↑ Summary