CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [newera] Replacing accented characters: Edit Log



Zhris
Enthusiast

May 21, 2016, 5:05 PM


Views: 5442
Re: [newera] Replacing accented characters

Taking what code you have provided, I cannot replicate your issue:

http://codepad.org/GWdDjYdq

Code
use utf8; 

my $first_name = 've';
my $last_name = 'Courneyer';
my %NEW = ( 'intid' => 2 );

$ID = lc(substr($first_name, 0, 1)) . lc(substr($last_name, 0, 1)) . $NEW{'intid'};

$ID =~ s//e/gi;
$ID =~ s//u/gi;
$ID =~ s//e/gi;
$ID =~ s//a/gi;
$ID =~ s//a/gi;
$ID =~ s//u/gi;
$ID =~ s//e/gi;
$ID =~ s//i/gi;
$ID =~ s//o/gi;
$ID =~ s//c/gi;
$ID =~ s//e/gi;
$ID =~ s//u/gi;
$ID =~ s//e/gi;
$ID =~ s//a/gi;
$ID =~ s//a/gi;
$ID =~ s//u/gi;
$ID =~ s//e/gi;
$ID =~ s//i/gi;
$ID =~ s//o/gi;

print $ID;


As Bill suggested, could you post a short complete example that demonstrates your problem.

It is highly recommended that you use both the strict and warnings pragmas. They will often help you identify problems that would otherwise be difficult to discover manually. For example, without these pragmas, undefined values are printed as blanks.

Chris


(This post was edited by Zhris on May 21, 2016, 5:11 PM)


Edit Log:
Post edited by Zhris (Enthusiast) on May 21, 2016, 5:11 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives