Shell::EnvImporter allows various kinds of shell scripts (csh, tcsh, bash, zsh and even perl) to be "sourced" into a Perl program. This module also allows restoration of the pre-sourced environment. WWW: https://metacpan.org/release/Shell-EnvImporter