panky245 has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am a newbie in Perl. Does anybody seems an error in my
following snippet. I am regularly getting the compilation error in it.
$char_lpar = "\x{00028}";
$char_rpar = "\x{00029}";
my $decval_1 = ord $char_lpar;
my $decval_2 = ord $char_rpar;
$data =~ s/$char_lpar/sprintf("%.4x;", $decval_1)/ge;
$data =~ s/$char_rpar/sprintf("%.4x;", $decval_2)/ge;
Best,
Pankaj Chaturvedi
following snippet. I am regularly getting the compilation error in it.
$char_lpar = "\x{00028}";
$char_rpar = "\x{00029}";
my $decval_1 = ord $char_lpar;
my $decval_2 = ord $char_rpar;
$data =~ s/$char_lpar/sprintf("%.4x;", $decval_1)/ge;
$data =~ s/$char_rpar/sprintf("%.4x;", $decval_2)/ge;
Best,
Pankaj Chaturvedi
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unicode Conversion
by haoess (Curate) on Jun 04, 2008 at 10:30 UTC | |
Re: Unicode Conversion
by graff (Chancellor) on Jun 05, 2008 at 00:10 UTC | |
Re: Unicode Conversion
by ikegami (Patriarch) on Jun 04, 2008 at 21:38 UTC |
Back to
Seekers of Perl Wisdom