TIMTOWTDI, There is more than one way to do it.

Given the nature of the data (and depending how it is supposed to be used later), I would probably use an array of hashes (AoH), something like this:

my @numbers = ( undef, { it => "uno", sp => "uno", fr => "un"}, { it => "due", sp => "dos", fr => "deux"}, { it => "tre", sp => "tres", fr => "trois"}, # ... );
which yields a structure like this:
0 ARRAY(0x6004f9c80) 0 undef 1 HASH(0x600636430) 'fr' => 'un' 'it' => 'uno' 'sp' => 'uno' 2 HASH(0x6005d18a8) 'fr' => 'deux' 'it' => 'due' 'sp' => 'dos' 3 HASH(0x6005d1920) 'fr' => 'trois' 'it' => 'tre' 'sp' => 'tres'
The advantage is that the array stays in order. Note that I created the first array element as undef, in order to have a natural correspondence between the element index and the numbers in he various languages (alternatively, I could have put a line for zero in all three languages). Each element of the array is a reference to a hash containing the number names in the various language.

To access to the Italian name of 2, simply try:

print $numbers[2]{it};
which should happily print "due".

In reply to Re: Need advice on checking two hashes values and keys by Laurent_R
in thread Need advice on checking two hashes values and keys by perlynewby

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.