Help for this page

Select Code to Download


  1. or download this
    BEGIN {
        my $level = $ENV{'FOO_DEBUG'} || 0;
    ...
    if (Foo::DEBUG) {
        print "We're debugging\n";
    }
    
  2. or download this
    sub BEGIN {
        my $level = $ENV{'FOO_DEBUG'} || 0;
        eval "*Foo::DEBUG = sub () {$1}" if $level =~ /^(\d+)$/s;
    }
    '???';
    
  3. or download this
    sub BEGIN {
        my $level = $ENV{'FOO_DEBUG'} || 0;
    ...
    do {
        print "We're debugging\n"
    };