| 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | package Importer::Zim::Base; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 5 | $Importer::Zim::Base::VERSION = '0.11.0'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # ABSTRACT: Base module for Importer::Zim backends | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use 5.010001; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 5 | ▶ | use Module::Runtime (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use Importer::Zim::Utils qw(DEBUG carp croak); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | sub _prepare_args { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 16 | ▶ | my $class = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_prepare_args: called CC=18 SCAR=29.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 16 | ▶ | my $package = shift | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | or croak qq{Usage: use $class MODULE => [\%OPTS =>] EXPORTS...\n}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 16 | ▶ | my $opts = _module_opts( ref $_[0] eq 'HASH' ? shift : {} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 16 | ▶ | my @version = exists $opts->{-version} ? ( $opts->{-version} ) : (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 16 | &Module::Runtime::use_module( $package, @version ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 16 | my $can_export = _can_export($package); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 16 | my ( @exports, %seen ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 16 | ▶ | @_ = @{"${package}::EXPORT"} unless @_ || !${"${package}::"}{'EXPORT'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@_ or not do {
"${package}::"
}->{"EXPORT"}
MC/DC50%1/2
@_ or not do {
"${package}::"
}->{"EXPORT"}
@_
not do {
"${package}::"
}->{"EXPORT"}
Truth table66%2/3
A or not(B)
A= @_B= not do {
"${package}::"
}->{"EXPORT"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 16 | ▶ | while (@_) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 166 | my @symbols = _expand_symbol( $package, shift ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 166 | ▶ | my $opts = _import_opts( ref $_[0] eq 'HASH' ? shift : {}, $opts ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | exists $opts->{-filter} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 166 | ▶ | and @symbols = grep &{ $opts->{-filter} }, @symbols; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 166 | for my $symbol (@symbols) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | croak qq{"$symbol" is not exported by "$package"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 89 | ▶ | if $opts->{-strict} && !$can_export->{$symbol}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$opts->{"-strict"} and not $can_export->{$symbol}
MC/DC0%0/2
$opts->{"-strict"} and not $can_export->{$symbol}
$opts->{"-strict"}
not $can_export->{$symbol}
Truth table66%2/3
A and not(B)
A= $opts->{"-strict"}B= not $can_export->{$symbol}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 89 | ▶ | croak qq{Can't handle "$symbol"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | if $symbol =~ /^[\$\@\%\*]/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 89 | my $sub = *{"${package}::${symbol}"}{CODE}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 89 | my $export = do { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 89 | ▶ | local $_ = $opts->{-as} // $symbol; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$opts->{"-as"} // $symbol
MC/DC0%0/2
$opts->{"-as"} // $symbol
$opts->{"-as"}
$symbol
Truth table66%2/3
A // B
A= $opts->{"-as"}B= $symbol
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 89 | ▶ | exists $opts->{-map} ? $opts->{-map}->() : $_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 89 | ▶ | croak qq{Can't find "$symbol" in "$package"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | unless $sub; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 89 | my $seen = $seen{$export}{$sub}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | croak qq{Can't import as "$export" twice} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 89 | ▶ | if keys %{ $seen{$export} } > 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 89 | ▶ | unless ($seen) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 87 | warn(qq{ Importing "${package}::${symbol}" as "$export"\n}) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | if DEBUG; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 87 | push @exports, { export => $export, code => $sub }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 16 | return @exports; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | sub _module_opts { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | state $IS_MODULE_OPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 16 | ▶ | = { map { ; "-$_" => 1 } qw(how filter map prefix strict version) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_module_opts: called CC=7 SCAR=20.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 16 | my %opts = ( -strict => !!1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 16 | my $o = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 16 | ▶ | $opts{-strict} = !!$o->{-strict} if exists $o->{-strict}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 16 | ▶ | exists $o->{-filter} and $opts{-filter} = $o->{-filter}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | exists $o->{-map} and $opts{-map} = $o->{-map} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 16 | ▶ | or exists $o->{-prefix} and $opts{-map} = sub { $o->{-prefix} . $_ }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.9
Branch: 1 branch
Condition44%4/9
exists $o->{'-map'} && ($opts{'-map'} = $o->{'-map'}) || exists $o->{'-prefix'} && ($opts{'-map'} = sub {
$o->{'-prefix'} . $_;
}
)
exists $o->{"-map"} and $opts{"-map"} = $o->{"-map"}
exists $o->{"-prefix"} and $opts{"-map"} = sub {
$o->{"-prefix"} . $_;
}
MC/DC0%0/4
exists $o->{'-map'} && ($opts{'-map'} = $o->{'-map'}) || exists $o->{'-prefix'} && ($opts{'-map'} = sub {
$o->{'-prefix'} . $_;
}
)
exists $o->{"-map"}
$opts{"-map"} = $o->{"-map"}
exists $o->{"-prefix"}
$opts{"-map"} = sub {
$o->{"-prefix"} . $_;
}
Truth table0%0/7
A and B || C and D
A= exists $o->{"-map"}B= $opts{"-map"} = $o->{"-map"}C= exists $o->{"-prefix"}D= $opts{"-map"} = sub {
$o->{"-prefix"} . $_;
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 16 | ▶ | if ( my @bad = grep { !$IS_MODULE_OPTION->{$_} } keys %$o ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | carp qq{Ignoring unknown module options (@bad)\n}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 16 | return \%opts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | # $opts = _import_opts($opts1, $m_opts); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | sub _import_opts { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | state $IS_IMPORT_OPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 166 | ▶ | = { map { ; "-$_" => 1 } qw(as filter map prefix strict) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_import_opts: called CC=11 SCAR=25.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 166 | my %opts = ( -strict => !!1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | exists $_[1]{-filter} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 166 | ▶ | and $opts{-filter} = _expand_filter( $_[1]{-filter} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 166 | ▶ | exists $_[1]{-map} and $opts{-map} = $_[1]{-map}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 166 | ▶ | exists $_[1]{-strict} and $opts{-strict} = $_[1]{-strict}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 166 | my $o = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 166 | ▶ | $opts{-as} = $o->{-as} if exists $o->{-as}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 166 | ▶ | exists $o->{-filter} and $opts{-filter} = _expand_filter( $o->{-filter} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | exists $o->{-map} and $opts{-map} = $o->{-map} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 166 | ▶ | or exists $o->{-prefix} and $opts{-map} = sub { $o->{-prefix} . $_ }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.9
Branch: 1 branch
Condition44%4/9
exists $o->{'-map'} && ($opts{'-map'} = $o->{'-map'}) || exists $o->{'-prefix'} && ($opts{'-map'} = sub {
$o->{'-prefix'} . $_;
}
)
exists $o->{"-map"} and $opts{"-map"} = $o->{"-map"}
exists $o->{"-prefix"} and $opts{"-map"} = sub {
$o->{"-prefix"} . $_;
}
MC/DC0%0/4
exists $o->{'-map'} && ($opts{'-map'} = $o->{'-map'}) || exists $o->{'-prefix'} && ($opts{'-map'} = sub {
$o->{'-prefix'} . $_;
}
)
exists $o->{"-map"}
$opts{"-map"} = $o->{"-map"}
exists $o->{"-prefix"}
$opts{"-map"} = sub {
$o->{"-prefix"} . $_;
}
Truth table0%0/7
A and B || C and D
A= exists $o->{"-map"}B= $opts{"-map"} = $o->{"-map"}C= exists $o->{"-prefix"}D= $opts{"-map"} = sub {
$o->{"-prefix"} . $_;
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 166 | ▶ | $opts{-strict} = !!$o->{-strict} if exists $o->{-strict}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 166 | ▶ | if ( my @bad = grep { !$IS_IMPORT_OPTION->{$_} } keys %$o ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | carp qq{Ignoring unknown symbol options (@bad)\n}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 166 | return \%opts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | sub _expand_filter { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 144 | ▶ | my $filter = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_expand_filter: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 144 | ▶ | ref $filter eq 'Regexp' ? sub {/$filter/} : $filter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | sub _expand_symbol { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 166 | ▶ | return $_[1] unless ref $_[1] || $_[1] =~ /^[:&]/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_expand_symbol: called CC=9 SCAR=25.1
Branch: 1 branch
Condition66%2/3
ref $_[1] or $_[1] =~ /^[:&]/
MC/DC50%1/2
ref $_[1] or $_[1] =~ /^[:&]/
ref $_[1]
$_[1] =~ /^[:&]/
Truth table66%2/3
A or B
A= ref $_[1]B= $_[1] =~ /^[:&]/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 5 | ▶ | return map { /^&/ ? substr( $_, 1 ) : $_ } @{ $_[1] } if ref $_[1]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 5 | ▶ | return substr( $_[1], 1 ) if $_[1] =~ /^&/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 3 | my ( $package, $tag ) = ( $_[0], substr( $_[1], 1 ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | my $symbols | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 3 | ▶ | = ${"${package}::"}{'EXPORT_TAGS'} && ${"${package}::EXPORT_TAGS"}{$tag} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
do {
"${package}::"
}->{'EXPORT_TAGS'} && do {
"${package}::EXPORT_TAGS"
}->{$tag}
MC/DC0%0/2
do {
"${package}::"
}->{'EXPORT_TAGS'} && do {
"${package}::EXPORT_TAGS"
}->{$tag}
do {
"${package}::"
}->{'EXPORT_TAGS'}
do {
"${package}::EXPORT_TAGS"
}->{$tag}
Truth table33%1/3
A && B
A= do {
"${package}::"
}->{'EXPORT_TAGS'}B= do {
"${package}::EXPORT_TAGS"
}->{$tag}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | or return $_[1]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 3 | ▶ | return map { /^&/ ? substr( $_, 1 ) : $_ } @$symbols; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | sub _can_export { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 16 | ▶ | my $package = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_can_export: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 16 | my %exports; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 16 | ▶ | for ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 16 | ▶ | ( ${"${package}::"}{'EXPORT'} ? @{"${package}::EXPORT"} : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 16 | ( ${"${package}::"}{'EXPORT_OK'} ? @{"${package}::EXPORT_OK"} : () ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 374 | ▶ | my $x = /^&/ ? substr( $_, 1 ) : $_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 374 | $exports{$x}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 16 | return \%exports; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 5 | ▶ | no Importer::Zim::Utils qw(DEBUG carp croak); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | #pod =encoding utf8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | #pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | #pod =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | #pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | #pod "The Earth is safe once more, GIR! Now let's go destroy it!" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | #pod – Zim | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | #pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | #pod No public interface. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | #pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | #pod =head1 DEBUGGING | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | #pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | #pod You can set the C<IMPORTER_ZIM_DEBUG> environment variable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | #pod for get some diagnostics information printed to C<STDERR>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | #pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | #pod IMPORTER_ZIM_DEBUG=1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | #pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | #pod =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | #pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | #pod L<Importer::Zim> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | #pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | #pod =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||