Enlightened Ones!

I, a most humble novice, would like to construct a database (for Excel) from a number of extracted sources. To save it as a file which then can be read into Excel or other application I would have to print out the results with rows constituting units and the values of the variables in the columns.

My first thought was to use a hash for each unit and then assign the same set of keys to each hash. As I have several thousands of units/rows it would be nice to generate "generic" hashes, i.e. %1, %2, %3, %4 and so on. Furthermore, it would be convenient to manipulate all of them (e.g., create the same keys, print all of them in new lines) simultaneously in loops. I recall that something like this existed in the good old days of Turbo Pascal. But how does this work in PERL if it works at all?

The description on CPAN covers hashes of hashes, which might be the thing to do, but not of a generic type. I also didn't find anything pertaining to this question on other perl tutorials.

Enlightenment would be greatly appreciated!


In reply to "Generic" variables/Hash of hashes by New Novice

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.