in reply to Re: hashes of array references
in thread hashes of array references

You are the Perl God....that was exactly my problem. Actually the code worked fine. I was just obtaining the number of elements wrong. Thank you very much.