in reply to How do I initiate a constant with variable value?

The $someVar = "someValue" assignment runs too late.

Anyway there's nothing preventing you from using an expression in the "use constant" statement:

use constant CNST => ($ENV{DEBUG} ? 1 : 0);

You just have to keep in mind that the use statement is executed in "compile time" and therefore you can't use values computed at "run time". On the other time the "compile time" is just before the "run time", not days or months before as with C or something else that lets you compile your program and store the compiled version. Even in case you use PAR or PerlApp or Perl2Exe!

Jenda
Enoch was right!
Enjoy the last years of Rome.