in reply to Dual constant files
Alternatively, you can write your constants in Java and write a constants module in Perl which uses AUTOLOAD to cull them from the java file as needed. This is a particularly cool way to do it (in my opinion) and it is a great use for AUTOLOAD. I actually did something similar for a company, where I had a hash table of constants and an AUTOLOADer to convert them to subroutines as needed. But watch out for non-scalar constants... arrays and hashes don't play as nice with eval.
Search for more on AUTOLOAD
|
|---|