Hello,
I need to compare two string (one in korean, one in hex format):
I have a string in a config file (korean):
player=리작
and a hex value in an data file:
'm_name': '\xeb\xa6\xac\xec\x9e\x91',
If I compare them 'manualy' they are identical
my $a = $cfg{'default.player'};
my $b = "\xeb\xa6\xac\xec\x9e\x91";
if ($a eq $b) {
print "indahouse\n";
}
But if I read in the hex value from the data file they are different :(:
open(ST, "<", $details) or die "Could not read $details: $!\n";
while (<ST>) {
if (/m_name/) {
if (/([\\\w]*)',$/) {
$name = $1;
print Dumper($name);
if ($name eq $cfg{'default.player'}) {
print "indahouse\n";
}
}
}
}
The dumper output for $name is:
$VAR1 = '\\xeb\\xa6\\xac\\xec\\x9e\\x91';
so it is not recogniced as hex value. I can't find how to convert this string :(
Any help appreciated!
Regards,
pax77
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.