in reply to change 'use constant' value through commandline arguments?
I am trying to put an option into my perlscripts which allows for a debugging switch which, when submitted to the script, prints out debugging messages.
It seems like you don't want a constants, because constants tend to never change. Constants should also not be influenced by external circumstances. Try using a variable instead, like $DEBUG.
And "constant debugging" sounds like a 24/7 job :)
If you decide to use a constant after all (bad idea, imho), you could delay definition until @ARGV is fully parsed, and then use use constant DEBUGGING => $minus_d_found;
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
|
|---|