Nital has asked for the wisdom of the Perl Monks concerning the following question:

I am very new using Perl. I am trying to create an array of hashes when reading information from files. The problem that I have is that I have several files. I create an array with the names of the files to open, then using "foreach" I open each file and add the information to the hash. my problem is that each file is overwriting previous file information. I am just so confused and I have tried several options, the way to solve this issue may be very easy but somehow I just don't see it, (lack of experience or just... not focus enough). Would someone help me? Thanks!

Replies are listed 'Best First'.
Re: array of hashes
by Kc12349 (Monk) on Sep 20, 2011 at 13:56 UTC

    Please show us some sample code and be sure to wrap it in <c> tags.

Re: array of hashes
by Anonymous Monk on Sep 20, 2011 at 13:58 UTC
Re: array of hashes
by aartist (Pilgrim) on Sep 20, 2011 at 15:40 UTC
    Problem could lie anywhere, but from your description, when you enter the data in the hash, check the code. Most likely you are overwriting information. Code same will help us to resolve it. You might also use debugger to examine the variables at various stages. Also use module Data::Dumper to examine them.