in reply to set env var at compile time
I'm guessing here but I think you have to satisfy ld.so and it reads from the process's C environment which is not updated by updating the perl variable %ENV. I see no problem with having a configuration file somewhere on disk but you'll need to write it in bash (or similar) and just make sure that invoking it is a part of your /etc/profile or how you invoke perl.
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In Section
Seekers of Perl Wisdom