Description: Software, development and everything.
software (33857) development and everything. (1)
Often times you’d want to share a set of environment variables between shell scripts and Perl scripts. Suppose that our variables are defined in a script called “etc/env”:
FOO=BARoo GURGLE="throbbozongo" In shell, we can easily include our “env” script with “source” command:
#!/bin/sh . etc/env # Or equivalent but more readable: source etc/env Right, but how do we include shell script in Perl script? The obvious solution is to read the file, split on /=/ and assign the variables, easy peasy: