Hashtable of arrays

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I've got a lexicon file which contains lines such as "chaise,
fauteuil=seat, chair" (one or several [more or less] synonymous French
words on the left, and their translation on the right). I'm trying to
build a hashtable that uses the French word as a key, and returns a
list containing English translations:


I wrote::

while (<FILE>){
    ($left, $right)=split(/=/,$_);
    @words_on_the_left=split (/, /, $left);
    @words_on_the_right=split (/, /, $right);
    for $word  (@words_on_the_left){
    if (!defined($translations))
        $translations=($translations, @words_on_the_right);

             print $translations;  


This doesn't work: instead of displaying English translations, the
script prints a list of numbers (which lets me think that the lists
are interpreted in a scalar context.) I tried to adapat examples I
found on the Web and I replaced in several places "$" with "@" or with
"@{$", and I also tried to replace
"$translations=($translations, @words_on_the_right);"
with "$translations=($translations,
\@words_on_the_right);", but I don't get the results I expected.

Site Timeline