Hi,
I'm trying to read environment variables from the Apache-configuration (httpd.conf) that were set either by the "PerlSetVar"- or the "PerlSetEnv"-directive within a Location-tag. The use case is to tell the application, whether it's running in a Dev, Test or Prod environment (having for example other locations to connect against a DB).
However, Plack seems to modify %ENV and thus remove the environment variable I have set by specifying PerlSetEnv within the config. On the other hand I found out, it's difficult to retrieve the global Apache2::RequestRec-object (which would contain the value set using PerlSetVar) somewhere in the middle of the application running on top of Plack. I managed to do it once by running the following code, but this does not seem to work on all servers - I did not search too much, why it worked out once but not somewhere else.
So, do you have any suggestions on how I could solve that problem (possibly without writing a new handler myself)? Or do you have even other approaches on how I could tell my application in what environment it runs (from the Apache-config)?
Thank you!
Manuel