---

How to access shell environment variables in Perl script

In some cases you may want to access shell environment variables (e.g., $PATH, $PWD, $HOME, $LANG) in your Perl script. While you can pass any needed variables to your Perl script via @ARGV argument array, this is actually not needed since Perl provides a way to access all available environment variables. Let’s find out how to access shell environment variables in Perl script.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis