$Your::Forager::DEBUG = 1; require Your::Forager;
use Badger::Debug modules => 'Your::Forager'; use Your::Forager;
Thus Spake Andy:
You have to be a little bit careful to set that
variable before your module gets loaded. In the first example, we
require to load it at runtime after we've had a chance to set it.
You can't use
use because it's a compile time statement which Perl effectively
moves up to the top of your script.
In the second example we let
Badger::Debug take care of it for us by
telling it the module(s) we want to enable debugging for. This itself is
use statement, so it's now safe to
use your module on
the next line.