in reply to Re: locale savvy comma as decimal operator
in thread locale savvy comma as decimal operator

I could imagine a fairly simple overload module to make all this work, and work transparently. It'd make runtime slower but if its really desired, its certainly possible.
  • Comment on Re^2: locale savvy comma as decimal operator

Replies are listed 'Best First'.
Re^3: locale savvy comma as decimal operator
by japhy (Canon) on May 25, 2005 at 23:57 UTC
    Except that commas and periods are used elsewhere in Perl. You'd have to enforce the user employ specific whitespace:
    @array = (1,2,3,4); # would be a syntax error, no? @array = (1, 2, 3, 4); # would be ok
    You'd have to be very careful about the whole thing. I wouldn't even expect Perl 6 to have an easy I18N option about this (but I could be wrong, those Perl 6ers are tough bastards).

    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
      For some reason, I thought 1.234,56 would have been parsed as a literal and would be available to overload via %^H to muck with. I just imagined that. Sorry.
        Dio, what is %^H? Supersearch turned up only this one node, and google ignores the punctuation.

        Can I learn about this via perldoc? Wis I had better perldoc magie... UPDATE: Duh, found it in perlvar.