http://qs321.pair.com?node_id=583931


in reply to Get default login environment

I just noticed Shell::EnvImporter, which purports to support many different shells and even has code to output unexported shell variables. It sure is longer than the snippet presented here, but if you need to support more than one (non-sh) shell, it might be helpful.