Filename | /home/lbr/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux/lib.pm |
Statements | Executed 31 statements in 432µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 482µs | 3.32ms | BEGIN@6 | lib::
1 | 1 | 1 | 28µs | 39µs | import | lib::
1 | 1 | 1 | 5µs | 14µs | BEGIN@8 | lib::
1 | 1 | 1 | 4µs | 4µs | _get_dirs | lib::
1 | 1 | 1 | 4µs | 4µs | CORE:ftis (opcode) | lib::
4 | 4 | 1 | 3µs | 3µs | CORE:ftdir (opcode) | lib::
1 | 1 | 1 | 400ns | 400ns | CORE:match (opcode) | lib::
0 | 0 | 0 | 0s | 0s | unimport | lib::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package lib; | ||||
2 | |||||
3 | # THIS FILE IS AUTOMATICALLY GENERATED FROM lib_pm.PL. | ||||
4 | # ANY CHANGES TO THIS FILE WILL BE OVERWRITTEN BY THE NEXT PERL BUILD. | ||||
5 | |||||
6 | 2 | 91µs | 2 | 3.33ms | # spent 3.32ms (482µs+2.84) within lib::BEGIN@6 which was called:
# once (482µs+2.84ms) by main::BEGIN@1 at line 6 # spent 3.32ms making 1 call to lib::BEGIN@6
# spent 8µs making 1 call to Config::import |
7 | |||||
8 | 2 | 283µs | 2 | 23µs | # spent 14µs (5+9) within lib::BEGIN@8 which was called:
# once (5µs+9µs) by main::BEGIN@1 at line 8 # spent 14µs making 1 call to lib::BEGIN@8
# spent 9µs making 1 call to strict::import |
9 | |||||
10 | 1 | 5µs | 1 | 3µs | my $archname = $Config{archname}; # spent 3µs making 1 call to Config::FETCH |
11 | 1 | 2µs | 1 | 1µs | my $version = $Config{version}; # spent 1µs making 1 call to Config::FETCH |
12 | 1 | 3µs | 1 | 800ns | my @inc_version_list = reverse split / /, $Config{inc_version_list}; # spent 800ns making 1 call to Config::FETCH |
13 | |||||
14 | |||||
15 | 1 | 900ns | our @ORIG_INC = @INC; # take a handy copy of 'original' value | ||
16 | 1 | 200ns | our $VERSION = '0.63'; | ||
17 | |||||
18 | # spent 39µs (28+11) within lib::import which was called:
# once (28µs+11µs) by main::BEGIN@1 at line 1 of opt.pl | ||||
19 | 1 | 200ns | shift; | ||
20 | |||||
21 | 1 | 200ns | my %names; | ||
22 | 1 | 900ns | foreach (reverse @_) { | ||
23 | 1 | 300ns | my $path = $_; # we'll be modifying it, so break the alias | ||
24 | 1 | 300ns | if ($path eq '') { | ||
25 | require Carp; | ||||
26 | Carp::carp("Empty compile time value given to use lib"); | ||||
27 | } | ||||
28 | |||||
29 | 1 | 13µs | 3 | 5µs | if ($path !~ /\.par$/i && -e $path && ! -d _) { # spent 4µs making 1 call to lib::CORE:ftis
# spent 600ns making 1 call to lib::CORE:ftdir
# spent 400ns making 1 call to lib::CORE:match |
30 | require Carp; | ||||
31 | Carp::carp("Parameter to use lib must be directory, not file"); | ||||
32 | } | ||||
33 | 1 | 800ns | unshift(@INC, $path); | ||
34 | # Add any previous version directories we found at configure time | ||||
35 | 1 | 700ns | foreach my $incver (@inc_version_list) | ||
36 | { | ||||
37 | my $dir = "$path/$incver"; | ||||
38 | unshift(@INC, $dir) if -d $dir; | ||||
39 | } | ||||
40 | # Put a corresponding archlib directory in front of $path if it | ||||
41 | # looks like $path has an archlib directory below it. | ||||
42 | 1 | 1µs | 1 | 4µs | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir) # spent 4µs making 1 call to lib::_get_dirs |
43 | = _get_dirs($path); | ||||
44 | 1 | 3µs | 1 | 1µs | unshift(@INC, $arch_dir) if -d $arch_auto_dir; # spent 1µs making 1 call to lib::CORE:ftdir |
45 | 1 | 2µs | 1 | 600ns | unshift(@INC, $version_dir) if -d $version_dir; # spent 600ns making 1 call to lib::CORE:ftdir |
46 | 1 | 5µs | 1 | 400ns | unshift(@INC, $version_arch_dir) if -d $version_arch_dir; # spent 400ns making 1 call to lib::CORE:ftdir |
47 | } | ||||
48 | |||||
49 | # remove trailing duplicates | ||||
50 | 1 | 5µs | @INC = grep { ++$names{$_} == 1 } @INC; | ||
51 | 1 | 5µs | return; | ||
52 | } | ||||
53 | |||||
54 | |||||
55 | sub unimport { | ||||
56 | shift; | ||||
57 | |||||
58 | my %names; | ||||
59 | foreach my $path (@_) { | ||||
60 | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir) | ||||
61 | = _get_dirs($path); | ||||
62 | ++$names{$path}; | ||||
63 | ++$names{$arch_dir} if -d $arch_auto_dir; | ||||
64 | ++$names{$version_dir} if -d $version_dir; | ||||
65 | ++$names{$version_arch_dir} if -d $version_arch_dir; | ||||
66 | } | ||||
67 | |||||
68 | # Remove ALL instances of each named directory. | ||||
69 | @INC = grep { !exists $names{$_} } @INC; | ||||
70 | return; | ||||
71 | } | ||||
72 | |||||
73 | # spent 4µs within lib::_get_dirs which was called:
# once (4µs+0s) by lib::import at line 42 | ||||
74 | 1 | 300ns | my($dir) = @_; | ||
75 | 1 | 100ns | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); | ||
76 | |||||
77 | 1 | 1µs | $arch_auto_dir = "$dir/$archname/auto"; | ||
78 | 1 | 500ns | $arch_dir = "$dir/$archname"; | ||
79 | 1 | 500ns | $version_dir = "$dir/$version"; | ||
80 | 1 | 600ns | $version_arch_dir = "$dir/$version/$archname"; | ||
81 | |||||
82 | 1 | 2µs | return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); | ||
83 | } | ||||
84 | |||||
85 | 1 | 5µs | 1; | ||
86 | __END__ | ||||
sub lib::CORE:ftdir; # opcode | |||||
# spent 4µs within lib::CORE:ftis which was called:
# once (4µs+0s) by lib::import at line 29 | |||||
# spent 400ns within lib::CORE:match which was called:
# once (400ns+0s) by lib::import at line 29 |