Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I'm russian perl programmer and I have a problem: There is the part of Perl code: # Remark: Cyrillic alphabet is used in the rest of code # Remark: in the variable $query first letter of first word is uppercased, b ut in the # array @keyw_array this letter is lowercased.It is necessary to mark up in the $query all the words that array @keyw_arra y contains by bold style. Then I write next instructions:code:
$query = "Красивый дом на Реке"; @keyw_array = qw(красивый реке);But on the server side the substitutions doesn't work properly (no change in the $query) although I specially used key 'i' in regex (s///i). Locally using pragma 'use locale' resolves the problem, i.e.:code:
$query =~ s/($_)/<strong>$1<\/strong>/i for @keyw_array; print $query; # prints Красивый дом на РекеAs you may see the substitutions have done properly. But when I try this on the server side I have no substitutions again. What is the matter? Is somebody able to point me the right way? Thanks. AZtpa,code:
use locale; $query =~ s/($_)/<strong>$1<\/strong>/i for @keyw_array; print $query; # prints <strong>Красивый</strong> дом на <strong>Реке</strong>
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.