| 1 | # | ||||||||||||||||||||||||||||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | package Rex::Exporter; | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 105 | ▶ | use v5.14.4; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 105 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 105 | ▶ | use Symbol; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 105 | our $VERSION = '1.16.1'; # VERSION | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 105 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 105 | our @EXPORT; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 3315 | ▶ | sub import { | ||||||||||||||||||||||||||
|
Subroutine
import: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||
| 18 | 3315 | my ( $mod_to_register, %option ) = @_; | |||||||||||||||||||||||||||
| 19 | 3315 | my ( $mod_to_register_in, $file, $line ) = caller; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 3315 | ▶ | if ( exists $option{register_in} && $option{register_in} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $option{"register_in"} and $option{"register_in"}
MC/DC50%1/2
exists $option{"register_in"} and $option{"register_in"}
exists $option{"register_in"}
$option{"register_in"}
Truth table66%2/3
A and B
A= exists $option{"register_in"}B= $option{"register_in"}
| |||||||||||||||||||||||||||||
| 22 | 1034 | $mod_to_register_in = $option{register_in}; | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 3315 | my $no_import = ""; | |||||||||||||||||||||||||||
| 26 | 3315 | ▶ | if ( exists $option{"-no"} && $option{"-no"} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $option{"-no"} and $option{"-no"}
MC/DC50%1/2
exists $option{"-no"} and $option{"-no"}
exists $option{"-no"}
$option{"-no"}
Truth table66%2/3
A and B
A= exists $option{"-no"}B= $option{"-no"}
| |||||||||||||||||||||||||||||
| 27 | 12 | $no_import = "," . join( ",", @{ $option{"-no"} } ) . ","; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 3315 | my $ref_to_export = qualify_to_ref( 'EXPORT', $mod_to_register ); | |||||||||||||||||||||||||||
| 31 | 3315 | my $ref_to_export_array = *{$ref_to_export}{ARRAY}; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 3315 | for my $reg_func ( @{$ref_to_export_array} ) { | |||||||||||||||||||||||||||
| 34 | 64976 | ▶ | if ( $no_import =~ m/,$reg_func,/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 12 | next; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 64964 | my $ref_to_reg_func_in_source_mod = | |||||||||||||||||||||||||||
| 39 | qualify_to_ref( $reg_func, $mod_to_register ); | ||||||||||||||||||||||||||||
| 40 | 64964 | my $ref_to_reg_func_in_target_mod = | |||||||||||||||||||||||||||
| 41 | qualify_to_ref( $reg_func, $mod_to_register_in ); | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 64964 | *{$ref_to_reg_func_in_target_mod} = *{$ref_to_reg_func_in_source_mod}; | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 105 | 1; | |||||||||||||||||||||||||||