In addition to the various switches that explicitly modify Perl's behavior, you can set various environment variables to influence various underlying behaviors. How you set up these environment variables is system dependent, but one trick you should know if you use sh, ksh, or bash is that you can temporarily set an environment variable for a single command, as if it were a funny kind of switch. It has to be set in front of the command:
PATH='/bin:/usr/bin' perl myproggie
You can do something similar with a subshell in csh and tcsh:
(setenv PATH "/bin:/usr/bin"; perl myproggie)
Otherwise, you'd typically set environment variables in some file with a name resembling .chsrc or .profile in your home directory. Under csh and tcsh you'd say:
setenv PATH '/bin:/usr/bin'
And under sh, ksh, and bash you'd say:
PATH='/bin:/usr/bin'; export PATH
Other systems will have other ways of setting these on a semi-permanent basis. Here are the environment variables Perl pays attention to:
chdir is called without an
Environment variables that control how Perl handles data specific to particular natural languages. See the online docs for perllocale.
chdir has no argument,
HOME is not set.
Used in executing subprocesses, and for finding
the program if the
-S switch is
A colon-separated list of directories in which to look for Perl library files before looking in the ...