| 1 | # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*- | ||||||||||||||||||||||||||||
| 2 | package CPAN::Debug; | ||||||||||||||||||||||||||||
| 3 | 24 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 24 | ▶ | use vars qw($VERSION); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 24 | $VERSION = "5.5002"; | |||||||||||||||||||||||||||
| 7 | # module is internal to CPAN.pm | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 24 | %CPAN::DEBUG = qw[ | |||||||||||||||||||||||||||
| 10 | CPAN 1 | ||||||||||||||||||||||||||||
| 11 | Index 2 | ||||||||||||||||||||||||||||
| 12 | InfoObj 4 | ||||||||||||||||||||||||||||
| 13 | Author 8 | ||||||||||||||||||||||||||||
| 14 | Distribution 16 | ||||||||||||||||||||||||||||
| 15 | Bundle 32 | ||||||||||||||||||||||||||||
| 16 | Module 64 | ||||||||||||||||||||||||||||
| 17 | CacheMgr 128 | ||||||||||||||||||||||||||||
| 18 | Complete 256 | ||||||||||||||||||||||||||||
| 19 | FTP 512 | ||||||||||||||||||||||||||||
| 20 | Shell 1024 | ||||||||||||||||||||||||||||
| 21 | Eval 2048 | ||||||||||||||||||||||||||||
| 22 | HandleConfig 4096 | ||||||||||||||||||||||||||||
| 23 | Tarzip 8192 | ||||||||||||||||||||||||||||
| 24 | Version 16384 | ||||||||||||||||||||||||||||
| 25 | Queue 32768 | ||||||||||||||||||||||||||||
| 26 | FirstTime 65536 | ||||||||||||||||||||||||||||
| 27 | ]; | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 24 | ▶ | $CPAN::DEBUG ||= 0; | ||||||||||||||||||||||||||
|
Condition50%1/2
$CPAN::DEBUG ||= 0
MC/DC0%0/1
$CPAN::DEBUG ||= 0
$CPAN::DEBUG
Truth table50%1/2
A
A= $CPAN::DEBUG
| |||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | #-> sub CPAN::Debug::debug ; | ||||||||||||||||||||||||||||
| 32 | sub debug { | ||||||||||||||||||||||||||||
| 33 | 69 | ▶ | my($self,$arg) = @_; | ||||||||||||||||||||||||||
|
Subroutine
debug: called CC=12 SCAR=34.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 69 | my @caller; | |||||||||||||||||||||||||||
| 36 | 69 | my $i = 0; | |||||||||||||||||||||||||||
| 37 | 69 | while () { | |||||||||||||||||||||||||||
| 38 | 207 | ▶ | my(@c) = (caller($i))[0 .. ($i ? 3 : 2)]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 39 | 207 | ▶ | last unless defined $c[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 40 | 207 | push @caller, \@c; | |||||||||||||||||||||||||||
| 41 | 207 | for (0,3) { | |||||||||||||||||||||||||||
| 42 | 414 | ▶ | last if $_ > $#c; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 345 | $c[$_] =~ s/.*:://; | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | 207 | for (1) { | |||||||||||||||||||||||||||
| 46 | 207 | $c[$_] =~ s|.*/||; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | 207 | ▶ | last if ++$i>=3; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | 69 | pop @caller; | |||||||||||||||||||||||||||
| 51 | 69 | ▶ | if ($CPAN::DEBUG{$caller[0][0]} & $CPAN::DEBUG) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 52 | 0 | ▶ | if ($arg and ref $arg) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$arg and ref $arg
MC/DC0%0/2
$arg and ref $arg
$arg
ref $arg
Truth table0%0/3
A and B
A= $argB= ref $arg
| |||||||||||||||||||||||||||||
| 53 | 0 | eval { require Data::Dumper }; | |||||||||||||||||||||||||||
| 54 | 0 | ▶ | if ($@) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 55 | 0 | $CPAN::Frontend->myprint("Debug(\n" . $arg->as_string . ")\n"); | |||||||||||||||||||||||||||
| 56 | } else { | ||||||||||||||||||||||||||||
| 57 | 0 | local $Data::Dumper::Sortkeys = 1; | |||||||||||||||||||||||||||
| 58 | 0 | $CPAN::Frontend->myprint("Debug(\n" . Data::Dumper::Dumper($arg) . ")\n"); | |||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | } else { | ||||||||||||||||||||||||||||
| 61 | 0 | my $outer = ""; | |||||||||||||||||||||||||||
| 62 | 0 | local $" = ","; | |||||||||||||||||||||||||||
| 63 | 0 | ▶ | if (@caller>1) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 64 | 0 | $outer = ",[@{$caller[1]}]"; | |||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||
| 66 | 0 | $CPAN::Frontend->myprint("Debug(@{$caller[0]}$outer): $arg\n"); | |||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | 24 | 1; | |||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | __END__ | ||||||||||||||||||||||||||||