Hi all

I'm getting this error on the following (test) script: 

Can't call method "x" without a package or object reference at test.pl line 12 
<ENT> line 1

What I want to do is create a HashMap where the keys are names of accented 
characters (as they are used in entities) and the values the UTF character 
itself. 

What am I doing wrong?

ENT has lines that look like this: 
aacute 00E1


here's my script (test.pl): 


---

#!/usr/bin/perl
use strict;
use warnings;

my %ent;
open ENT, "entities.txt" or die "cannot read entities: $!";

while (<ENT>) {
        chomp;
        m/^(.+) (.+)$/;
        print "[$1]\t[$2]\n";
        $ent{$1} = \x{$2};
}


---

before the error, the script prints (as expected): "[aacute]\t[00E1]\n"

Is there anything very fundamental I'm overlooking? (please be patient with me, 
I'm not a computer scientist, but a linguist doing some basic programming.)

Many thanks for your help!

MCoiff

-- 
Nur bis 16.03.! DSL-Komplettanschluss inkl. WLAN-Modem für nur 
17,95 ¿/mtl. + 1 Monat gratis!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to