Perl in the Terminal

Jump to First Reply
Posted:
in Genius Bar edited January 2014
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:



Quote:

[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?

Comments

  • Reply 1 of 3
    1337_5l4xx0r1337_5l4xx0r Posts: 1,558member
    Quote:

    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
     0Likes 0Dislikes 0Informatives
  • Reply 2 of 3
    acollinsacollins Posts: 60member
    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.
     0Likes 0Dislikes 0Informatives
  • Reply 3 of 3
    gargoylegargoyle Posts: 660member
    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).



    Code:




    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



    Code:




    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

    Code:




    LC=C

    LC_ALL=C







    probably at the bottom.



    enjoy.
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.