Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

using pragma 'use locale'?
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.
code:
$query = "Красивый дом на Реке"; @keyw_array = qw(красивый реке);
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 =~ s/($_)/<strong>$1<\/strong>/i for @keyw_array; print $query; # prints Красивый дом на Реке
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:
use locale; $query =~ s/($_)/<strong>$1<\/strong>/i for @keyw_array; print $query; # prints <strong>Красивый</strong> дом на <strong>Реке</strong>
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,

Report this thread to moderator Post Follow-up to this message
Old Post
Webmaster
12-24-04 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL CGI Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Forum Jump:
All times are GMT. The time now is 08:17 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.