PDA

View Full Version : Perl in the Terminal


acollins
05-13-2003, 05:42 PM
I'm a terminal nOOb, and just learning Perl in an Internet Programming Class I'm taking. Every time that I run a Perl script, I get the following error message:

[Andrews-Computer:~/desktop] acollins% perl code.pl
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "en"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Then the code executes just fine. I guess it's not a big deal because it still works, I just thought perhaps I could do something to fix it.

Any suggestions?
:???:

1337_5L4Xx0R
05-15-2003, 05:12 AM
Originally posted by acollins
I'm a terminal nOOb, and just learning Perl in an Internet Programming Class I'm taking. Every time that I run a Perl script, I get the following error message:



Then the code executes just fine. I guess it's not a big deal because it still works, I just thought perhaps I could do something to fix it.

Any suggestions?
:???:
add:

export LC=C
export LC_ALL=C

to your .tcshrc

or type that in manually every time you launch Terminal.app

acollins
05-15-2003, 10:04 AM
Thanks a lot for the info. Just one more question...

Where is my .tcshrc? I made all the invisible files visible and then did a search, but got no results.

Thanks a lot for your help.

Gargoyle
05-15-2003, 10:44 AM
export does not work in tcsh, its a command for the bash shell.

Enter the following commands in a tcsh terminal shell (the default shell for teminal.app).


cd ~
pico .tcshrc


This will put you into your home folder (~) and start the pico editor so you can CREATE your .tcshrc file. Enetr these lines


setenv LC C
setenv LC_ALL C


Now press control-x, and hit Y then enter to confirm the save. Then type exit, and completely quit the terminal app.

Now restart the terminal app and type "env". You should see a list of environment vars. Somewhere in the list you should see

LC=C
LC_ALL=C

probably at the bottom.

enjoy.