in reply to Setting environment variables by reading them from a configuration file

A trick that I've picked up from somewhere:
# Put this in the beginning of your program if (@ARGV && $ARGV[0] eq '--environment_set') {shift} else {@ARGV = map {s/'/'"'"'/g; "'$_'"} @ARGV; exec "source '$fname'; exec '$0' --environment_set @ARGV"}
  • Comment on Re: Setting environment variables by reading them from a configuration file
  • Download Code