# set debugging switch to OFF my $debug_switch = 0; # go through the argument evaluation at compile time BEGIN { # check each argument foreach $_ (@ARGV) { # is the debug switch submitted? if (/^-d$/i) { # yup. set debugging switch to ON $debug_switch = 1; } } } # set DEBUGGING to the debug_switch value use constant DEBUGGING => $debug_switch;