in reply to Re^2: 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've no idea. To either the question or it's relevance.

But if it doesn't, I'd say that was a bug in Perl or the pragma.


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^3: Using split, splice, and join to remove time from scalar context return of localtime()

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

    Your solution requires localtime to return strings with specific arrangement of characters. If localtime returns a string based on the locale, your solution could break.

    I don't know how to change locale to test.

      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.

        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.