Tag Archives: perl

Setting locale failed on Mac OS X Mavericks

If you using Mac OS X (in my case, I’m using Mavericks), during SSH session, you may see this kind of error in your terminal:

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").

To solve this, edit .bash_profile file in your host/local machine

sudo nano ~/.bash_profile

and add this line:

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

Credit to: Agile Faqs

Mac OS X – Can’t locate Switch.pm

Recently, I want to run some script using Perl. But I encountered this:

Can’t locate Switch.pm in @INC (@INC contains: /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .)

So, the solution is: