Yes, it should be possible but the syntax might get sticky. As scorpio17 says in this thread, what you want to do with the data is one the the deciding factors in how you want to store it. (Along with other factors). If the data is too large to load into memory, you may need to consider some of the suggestions offered by others here.

If the requirement is just to produce output like you provided, a Hash of Hashes may be a good choice.