New Novice has asked for the wisdom of the Perl Monks concerning the following question:
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "Generic" variables/Hash of hashes
by mirod (Canon) on Feb 14, 2005 at 12:32 UTC | |
|
Re: "Generic" variables/Hash of hashes
by sh1tn (Priest) on Feb 14, 2005 at 11:33 UTC | |
|
Re: "Generic" variables/Hash of hashes
by dragonchild (Archbishop) on Feb 14, 2005 at 13:33 UTC | |
|
Re: "Generic" variables/Hash of hashes
by Taulmarill (Deacon) on Feb 14, 2005 at 12:37 UTC | |
by New Novice (Sexton) on Feb 14, 2005 at 12:51 UTC | |
by Taulmarill (Deacon) on Feb 14, 2005 at 13:18 UTC | |
|
Re: "Generic" variables/Hash of hashes
by holli (Abbot) on Feb 14, 2005 at 12:28 UTC |