At 12:04 AM 10/26/2002 +0200, Jenda Krynicky wrote:
>From: Robert Citek <[EMAIL PROTECTED]>
>> This sounds like something that perl should be able to handle by
>> changing the locale so that you do not have to alter the source file.
>
>I hope NOT! This would break tons of modules!
Perhaps. But then those modules should be upgraded to handle
internationalization.
>Read
> perldoc perllocale
On your suggestion, I did. I highly recommend it for anyone suffering from
insomnia. :)
>From the first paragraph: "Perl is also aware that some character other
than '.' may be preferred as a decimal point, and that output date
representations may be language-specific." This suggests that I should be
able to add together a list of real numbers which have the decimal point
specified by a character other than ".".
How does one do that? For example, I would like to create a perl script
called sum.locale.pl to do this:
# cat <<EOF | sum.locale.pl
1,25
1.000,5
100,75
EOF
The sum is :1.102,25
Further into the documentation, there is a script to display an integer in
the current locale. Although the script ran, the output was always the
same no matter which locale I used. I worry that I am not changing the
locale correctly.
What would be really useful in the documentation is a good example of how
to change locales and the effects. For example, in non-perl pseudo-code:
1- show current locale
2- display 123456.789 and July 1st, 2001
3- change to different locale
4- show new current locale
5- display 123456.789 and July 1st, 2001
6- repeat 3-5 for any number of locales
I'd be happy to write the sample code if someone could point me in the
right direction.
Regards,
- Robert
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]