This looks like a bug (hfff!) in your version of Perl.  On my Windows XP
combo Perl/Apache (ActivePerl 5.6.1 Build 635), it barfs on both
expressions, thus:-

#!/usr/local/bin/perl

use strict;
use warnings;
use Data::Dumper;
use charnames ':full';

$a = "\N{LATIN SMALL LETTER A WITH GRAVE}";
$b = "\N{LATIN CAPITAL LETTER A WITH GRAVE}";

$a =~ m/[$a]/i ? print "a is good\n" : print "a is bad\n";
$b =~ m/[$b]/i ? print "b is good\n" : print "b is bad\n";

$a =~ m/[$b]/i ? print "a is good\n" : print "a is bad\n";
$b =~ m/[$a]/i ? print "b is good\n" : print "b is bad\n";

print Dumper($a, $b);

produces:-

C:\...\PERL Documents>perl tt5.pl
a is good
b is good
a is bad
b is bad
$VAR1 = 'α'; # Hey, it's...
$VAR2 = '└'; # Windoze (GStC)

The same thing happens on a Solaris system, whose 5.6.1 Perl dates from 26
Apr 2001 (no build given).

But on a regular ActivePerl 5.8.4 Build 810, I get:-

C:\...\PERL Documents>perl tt5.pl
a is good
b is good
a is good
b is good
$VAR1 = '\x{e0}';
$VAR2 = '\x{c0}';

HTH, GStC.

 

-----Original Message-----
From: Rajarshi Das [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 02, 2005 7:03 PM
To: beginners@perl.org
Subject: z/OS unicode problem.

Hi,
I had a question regarding utf-ebcdic issues on z/OS. I tried this on a
perl-5.8.6.  If I use a unicode character within a character class and try
matching the same using a regular expression, I get a failure.

e.g. if I write this ;

use charnames:full;

$a = "\N{LATIN SMALL LETTER A WITH GRAVE}"; $b = "\N{LATIN CAPITAL LETTER A
WITH GRAVE}";

$a =~ m/[$b]/i;

This fails whereas,

$b =~ m/[$a]/i;
passes.

Does anyone have thoughts on why this might be happening ? Alternately,
could someone let know as to who could help ?

Thanks in advance,
Rajarshi.

_________________________________________________________________
Click, Upload, Print. http://www.kodakexpress.co.in?soe=4956 Deliver in
India.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Reply via email to