“perl: warning: Setting locale failed”

This post shows a simple way of fixing  warning when running perl in linux.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = “en_US.UTF-8”
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).


on your home directory:

1. Edit your user bash_profile

vi .bash_profile

2. Insert the following:

export LANGUAGE=en_US.UTF-8

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

3. Reload your Bash Profile
# source  .bashrc

This should fix the warning you were getting