Home: Perl Programming Help: Beginner:
***case sensitive problem***



Jesjoshan
Novice

Aug 25, 2016, 12:49 AM


Views: 2840
***case sensitive problem***

While I converted some named entity to hexa-decimal, it has some case problem;

$xmltext =~s/\ω/\&\#x003C9;/g;
$xmltext =~s/\Ω/\&\#x003A9;/g;

Ω also converted to ω. I need to convert
ω should ω
Ω should Ω

Kindly advise.


BillKSmith
Veteran

Aug 25, 2016, 5:00 AM


Views: 2832
Re: [Jesjoshan] ***case sensitive problem***

Please post a complete program which we can run and see your problem. I cannot duplicate it.

Code
use strict; 
use warnings;
my @ins = ('ω', 'Ω');
foreach my $xmltext (@ins) {
print "$xmltext => ";
$xmltext =~s/\ω/\&\#x003C9;/g;
$xmltext =~s/\Ω/\&\#x003A9;/g;
print $xmltext, "\n";
}

OUTPUT:
ω => ω
Ω => Ω

Good Luck,
Bill


Jesjoshan
Novice

Aug 25, 2016, 8:53 PM


Views: 2820
Re: [BillKSmith] ***case sensitive problem***

Thanks a lot Bill, Now it's working.