in reply to change 'use constant' value through commandline arguments?
It isn't perfect, but: use constant DEBUGGING => grep $_ eq "-d", @ARGV; otherwise you'd need to do all of the argument processing inside a BEGIN block:
- tye (but my friends call me "Tye")my %options; BEGIN { # process @ARGV, putting results in %options } use constant DEBUGGING => $options{debug};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re: change 'use constant' value through commandline arguments?
by neuroball (Pilgrim) on Mar 14, 2002 at 20:19 UTC | |
by Kanji (Parson) on Mar 15, 2002 at 01:27 UTC | |
by blakem (Monsignor) on Mar 14, 2002 at 23:45 UTC | |
by Sweeper (Pilgrim) on Mar 15, 2002 at 06:50 UTC | |
by neuroball (Pilgrim) on Mar 15, 2002 at 18:52 UTC |