File: Debugger1.pm

package info (click to toggle)
libbadger-perl 0.16-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,400 kB
  • sloc: perl: 11,004; makefile: 9
file content (22 lines) | stat: -rw-r--r-- 626 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# test module used by t/core/debug.t

# The DEBUG import hook in Badger::Debug defines a DEBUG constant.
# In this case, we define the default value to be 0.  However, that
# default can be over-ridden by defining $My::Debugger::DEBUG before
# loading the module.  The benefit of this approach is that the DEBUG
# constant will be resolved at compile time so that there is no overhead
# for statements like: $self->debug(...) if DEBUG;

package My::Debugger1;

use Badger::Debug
    DEBUG => 0; 

sub wibble {
    my ($self, $value) = @_;
    return DEBUG        
        ? 'debugging wibble'
        : 'normal wibble';
}

1;