CamelDung has asked for the wisdom of the Perl Monks concerning the following question:

Greetings knowledgeable Monks,

I'm working with a large CGI script that produces man page output via the web. Everything works "just ducky", except, perl complains:

ctype locale: Invalid argument

I've spent quite some time attempting to diagnose this w/o success. My system knows it's locale settings are correct - as does man. Seems perl has an issue. Any thoughts greatly appreciated.

Thank you for all your time and consideration.

Replies are listed 'Best First'.
Re: ctype locale: Invalid argument - what might cause this error?
by Corion (Patriarch) on Jan 03, 2010 at 13:02 UTC

    So, what is your system locale? And what is your system? And where in your CGI does the error happen? Is it fatal? Where do you see the error? What modules does your CGI use? Have you tried to whittle down the CGI script to the relevant parts so that it still outputs the error but is shorter than 20 lines?

      non-fatal, shows up as perl output in the servers error log exactly as posted.
      No other errors, or clues.

      Thank you for taking the time to respond.
      --
      Advance perl usage;
      Do something really cool with it, and then share it with everyone.
Re: ctype locale: Invalid argument - what might cause this error?
by marto (Cardinal) on Jan 03, 2010 at 13:24 UTC

      Apologies to you both, and to everyone else - I know better than to have posted such a question w/o some "clues" to work with. I'm afraid I've been up too many hours, and need some rest.

      In answer to your question - or rather, to place what I should have already;

      sys UNIX
      # locale
      LANG=
      LC_CTYPE="C"
      LC_COLLATE="C"
      LC_TIME="C"
      LC_NUMERIC="C"
      LC_MONETARY="C"
      LC_MESSAGES="C"
      LC_ALL=
      

      Once again, sorry for the omissions, and thank you for all your time and consideration.

      Advance perl usage; Do something really cool with it, and then share it with everyone.
        P.S. Just a "hunch"; do I need to set a perl env in the script to make perl happy, maybe?
        --
        Advance perl usage;
        Do something really cool with it, and then share it with everyone.