Creating a registry of environment variables
I want a registry of environment variables. If I see someone using one, I want to know what it does and what code or programs uses that. Or, given a program, what are all the variables that might affect it?
Rather than do the whole thing, I let myself do part of the first bit. I crawled all of my installed modules to pull out the keys used with
%ENV. My solution (here's the gist) does some dumb matching then passes the result to PPI. It's probably another easy step to make PPI find uses of
%ENV too (and skip all the mentions in the docs).
Some modules define their own variables, and some of those are even documented. Many use variables that they expect you to know about already, such as
From just the stuff I had installed (about 20 different perls), here are the most frequent, with their count:
CONTENT_TYPE: 474 PERL_CORE: 481 TERM: 511 PAGER: 631 TMPDIR: 837 PERL5OPT: 977 PWD: 1919 PATH: 1997 PERL5LIB: 2187 HOME: 2325
The next time I have a chance to work on this, I'll get into into some sort of data store along with the module that uses each. The harder task to is to identify the modules that create the variables. I suppose that I could discount the ones that show up in several different modules.