in reply to Re^4: Using split, splice, and join to remove time from scalar context return of localtime()
in thread Using split, splice, and join to remove time from scalar context return of localtime()

I don't know how to change locale

And neither do I. And which given your undoubted spread of knowledge combined with my own seems sufficient reason to not waste time trying to cater for that possibility.

For example, sort (and eq, ne et al.) will often not do what is expected by my algorithms (or yours), if the locale on the machines our code is run on is incompatible.

For those that do need to know how, they've probably worked out how (something to do with POSIX::setlocale() perhaps?), and will likely also be well versed in tracking down and correcting problems that arise as a result.

And if either of us ever actually need to know, we'll probably be able to work it out also.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"
  • Comment on Re^5: Using split, splice, and join to remove time from scalar context return of localtime()
  • Download Code

Replies are listed 'Best First'.
Re^6: Using split, splice, and join to remove time from scalar context return of localtime()
by ikegami (Patriarch) on Dec 18, 2009 at 07:57 UTC

    For example, sort (and eq, ne et al.) will often not do what is expected by my algorithms (or yours), if the locale on the machines our code is run on is incompatible.

    That's not true.

    eq and ne are never affected by the locale.

    As for lt, le, cmp (which includes the default sort), ge and gt, you need to use use locale; to make them observe the locale. That's why you normally don't have to worry about the user's locale.

      That's why you normally don't have to worry about the user's locale.

      Ditto localtime.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.