in reply to Passing hash names in a file

Well clearly it's a bad idea to have variable names which are words in some human language. Instead, have a two-level hash, in which the top-level key is the word. E.g.
my %trans; # a translation table. $trans{'current'} = { eng => 'Current', ca => 'Courant', . . . };
Then to get the list of all the words in the glossary, you'd just take the keys of the hash, i.e.     @glossary_words = keys %trans;

jdporter
...porque es dificil estar guapo y blanco.

Replies are listed 'Best First'.
Re: Re: Passing hash names in a file
by heezy (Monk) on Dec 09, 2002 at 20:32 UTC

    True it would be a lot better to impliment it that way but this file is referenced but quite a few scripts that I do not have control over and so I can not change the structure of the data within glossary.pl

    Can you suggest how I could obtain the names of the hashes without changing the strcture of the data?

    Thanks for your comments so far

    M

        Now now dont be like that. :-) grep is available from the Cygwin distro for those that don't like findstr.

        --- demerphq
        my friends call me, usually because I'm late....