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