See
if
$ perl -le " use if $ENV{maplat_debug}, lib => 666; print for @INC"
C:/perl/site/5.12.2/lib/MSWin32-x86-multi-thread
C:/perl/site/5.12.2/lib
C:/perl/5.12.2/lib/MSWin32-x86-multi-thread
C:/perl/5.12.2/lib
.
$ export maplat_debug=6
$ perl -le " use if $ENV{maplat_debug}, lib => 666; print for @INC"
666
C:/perl/site/5.12.2/lib/MSWin32-x86-multi-thread
C:/perl/site/5.12.2/lib
C:/perl/5.12.2/lib/MSWin32-x86-multi-thread
C:/perl/5.12.2/lib
.
See also
Log::Log4perl::CommandLine which I discovered right this minute
use if Log::Log4perl->get_logger->is_debug, ...;
# Then run your program
my_program.pl --verbose
my_program.pl -v
my_program.pl --debug
my_program.pl -d
my_program.pl --quiet
my_program.pl -q
my_program.pl --debug
my_program.pl --debug MyModule
my_program.pl --debug MyModule,MyOtherModule --debug Foo