Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: any use of 'use locale'?

by Khen1950fx (Canon)
on Nov 23, 2009 at 01:32 UTC ( #808706=note: print w/replies, xml ) Need Help??

in reply to any use of 'use locale'?

Just some thoughts... I ran your script as is and I got the following results:

C R S ? Z R S T U V W X Y Z

The results tell me that the encoding is the special locale C which maps to ASCII, the ? mark tells you that something is missing. C maps to ASCII, but the does not. I would guess that you have to declare the locale, so I tried this:

#!/usr/bin/perl use strict; no warnings 'utf8'; use utf8; use POSIX; use locale; print setlocale(LC_CTYPE(), 'et_EE.UTF-8'), "\n\n"; my(@real) = ('R', 'S', '', 'Z'); my(@fake) = ('R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); print "@real\n", "@fake\n";

And the results:

et_EE.UTF-8 R S Z R S T U V W X Y Z
I wasn't comfortable with the range operator, so I deleted that. Personally, I think that it might be a platform-specific problem.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://808706]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2018-06-24 19:27 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.