#!/usr/bin/perl use strict; use utf8; use Text::Unidecode; # I download text with embedded HTML numbers , as in # "advice to Gwenda to “let sleeping murder lie.”" # # 8220 is a decimal number for 'left double quotation mark'."; # # To convert this HTML number to a double quote, one can use # the Perl module Text::Unicode. It seems however that one # needs to use a hexadecimal number (in this case '201c') # for the unidecode() function. print "Function unidecode() prints the 'left double quotation mark': "; print unidecode("\x{201c}") . "\n"; # I can get the hexadecimal number as follows: my $hexval = sprintf("%x", 8220); # MY ACTUAL QUESTION: how to get $hexval into the call to # unidecode()? unidecode("\x\{".$hexval."\}") does not do # the job, and I have tried half a dozen other ways that I # thought would work, but do not. # Does anyone know how to do this?