| 1 | package lib::tiny; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # use strict; # this works but is disabled for production, since it doesn't gain any thing in this mod and adds appx 184K to memory | ||||||||||||||||||||||||||||
| 4 | 2 | $lib::tiny::VERSION = 0.7; | |||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 3 | ▶ | sub import { | ||||||||||||||||||||||||||
|
Subroutine
import: called CC=5 SCAR=17.2
| |||||||||||||||||||||||||||||
| 7 | 3 | shift; | |||||||||||||||||||||||||||
| 8 | 3 | my %seen; | |||||||||||||||||||||||||||
| 9 | 3 | for ( reverse @_ ) { | |||||||||||||||||||||||||||
| 10 | 5 | ▶ | next if !defined $_ || $_ eq ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not defined $_ or $_ eq ""
MC/DC0%0/2
not defined $_ or $_ eq ""
not defined $_
$_ eq ""
Truth table33%1/3
not(A) or B
A= not defined $_B= $_ eq ""
| |||||||||||||||||||||||||||||
| 11 | 5 | ▶ | unshift @INC, $_ if -d $_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | # if we can do this without Config and 'tiny' File::Spec-ness to properly join their names into a path... | ||||||||||||||||||||||||||||
| 14 | # handle '$_/@{'inc_version_list'} here | ||||||||||||||||||||||||||||
| 15 | # unshift @INC, "$_/$archname") if -d "$_/$archname/auto"; | ||||||||||||||||||||||||||||
| 16 | # unshift @INC, "$_/$version") if -d "$_/$version"; | ||||||||||||||||||||||||||||
| 17 | # unshift @INC, "$_/$version/$archname") if -d "$_/$version/$archname"; | ||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | 3 | @INC = grep { $seen{$_}++ == 0 } @INC; | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 3 | ▶ | sub unimport { | ||||||||||||||||||||||||||
|
Subroutine
unimport: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 23 | 3 | shift; | |||||||||||||||||||||||||||
| 24 | 3 | my %ditch; | |||||||||||||||||||||||||||
| 25 | 3 | @ditch{@_} = (); | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | # if import ever does version/archname/inc_version_list paths we need to remove them here | ||||||||||||||||||||||||||||
| 28 | 3 | @INC = grep { !exists $ditch{$_} } @INC; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 2 | 1; | |||||||||||||||||||||||||||