in reply to Re: (tye)Re: change 'use constant' value through commandline arguments?
in thread change 'use constant' value through commandline arguments?
Rather than just setting it to 1, it may be more flexible to use $debug_switch++ instead; that way you could increase the debug level with every -d on the command-line, letting you do things like...
use constant VAGUE => 0; use constant DETAILED => 1; use constant PEDANTIC => 2; if ( @x ) { warn( "\@x is set\n" ) if DEBUG > VAGUE; warn( scalar(@x)," elements\n" ) if DEBUG > DETAILED; { local $" = "\n "; warn( "They are...\n @x\n" ) if DEBUG > PEDANTIC; } }
Lame example, but hopefully you get the point... :)
--k.
|
|---|