« lib/Devel/Trepan/CmdProcessor/Command/Set.pm
↑ Summary
lib/Devel/Trepan/CmdProcessor/Command/Show.pm »
| 1 | package Devel::Trepan::DB::Use; | ||||||||||||||
| 2 | =head1 SUMMARY | ||||||||||||||
| 3 | |||||||||||||||
| 4 | A callback hook for L<Devel::Trepan>'s when I<use> gets called. | ||||||||||||||
| 5 | |||||||||||||||
| 6 | =cut | ||||||||||||||
| 7 | |||||||||||||||
| 8 | 2 | ▶ | use File::Basename; use File::Spec; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 9 | |||||||||||||||
| 10 | 2 | ▶ | BEGIN { | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | 2 | unshift @INC, \&use_hook; | |||||||||||||
| 12 | }; | ||||||||||||||
| 13 | |||||||||||||||
| 14 | 170 | ▶ | sub use_hook { | ||||||||||||
|
Subroutine
use_hook: called CC=3 SCAR=18.5
Pod
undocumented
| |||||||||||||||
| 15 | 0 | ▶ | my ($coderef, $filename) = @_; # $coderef is \&my_sub | ||||||||||||
|
Subroutine
use_hook: not called CC=3 SCAR=18.5
Pod
undocumented
| |||||||||||||||
| 16 | ## FIXME: allow for calling the debugger on "use". | ||||||||||||||
| 17 | # print "++use_hook ", $filename, "\n"; | ||||||||||||||
| 18 | 0 | ▶ | if ($filename eq 'SelfLoader.pm') { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 19 | 0 | my $dirname = dirname(__FILE__); | |||||||||||||
| 20 | 0 | my $SelfLoader_file = File::Spec->catfile($dirname, 'SelfLoader.pm'); | |||||||||||||
| 21 | 2 | ▶ | no strict 'refs'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 22 | 0 | ▶ | open(FH, '<', $SelfLoader_file) or return undef; | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 23 | 0 | return *FH; | |||||||||||||
| 24 | } | ||||||||||||||
| 25 | return undef | ||||||||||||||
| 26 | 0 | } | |||||||||||||
| 27 | |||||||||||||||
| 28 | 2 | 1; | |||||||||||||