| 1 | package Alzabo::Debug; | ||||||||||
| 2 | |||||||||||
| 3 | 11 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | BEGIN | ||||||||||
| 6 | 11 | ▶ | { | ||||||||
|
Subroutine
BEGIN: called CC=7 SCAR=22.8
| |||||||||||
| 7 | 11 | my %constants = | |||||||||
| 8 | ( SQL => 0, | ||||||||||
| 9 | TRACE => 0, | ||||||||||
| 10 | METHODMAKER => 0, | ||||||||||
| 11 | REVERSE_ENGINEER => 0, | ||||||||||
| 12 | ); | ||||||||||
| 13 | |||||||||||
| 14 | 11 | ▶ | if ( $ENV{ALZABO_DEBUG} ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | { | ||||||||||
| 16 | 0 | my %debug = map { uc $_ => 1 } split /\|/, $ENV{ALZABO_DEBUG}; | |||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | if ( $debug{ALL} ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | { | ||||||||||
| 20 | 0 | @constants{ keys %constants } = (1) x keys %constants; | |||||||||
| 21 | } | ||||||||||
| 22 | else | ||||||||||
| 23 | { | ||||||||||
| 24 | 0 | foreach ( grep { exists $constants{$_} } keys %debug ) | |||||||||
| 25 | { | ||||||||||
| 26 | 0 | ▶ | $constants{$_} = $debug{$_} ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | } | ||||||||||
| 28 | } | ||||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 11 | ▶ | while ( my ($k, $v) = each %constants ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | { | ||||||||||
| 33 | 44 | ▶ | eval "use constant $k => $v"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 34 | 44 | ▶ | die $@ if $@; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | } | ||||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | |||||||||||
| 39 | 11 | 1; | |||||||||
| 40 | |||||||||||
| 41 | __END__ | ||||||||||