in reply to Different hashes?

You're clearing out the entire hash each time through the loop and replacing it with new contents. You want push @{ $AllProducts{ $Category } }, [ $ID, [ $Name, $Type, $Size ] ]. See perldoc perlreftut, perldoc perldsc, and perldoc perllol.

Replies are listed 'Best First'.
Re: Re: Different hashes?
by Happy-the-monk (Canon) on Mar 26, 2004 at 15:12 UTC

    Fletch and borisz:
    the outer array referencing brackets [ ] are still wrong, take them away and you got it right.

      Actually what he probably really wants is a HOH and should be doing something like:

      $AllProducts{ $Category }->{ $ID } = { name => $Name, type => $Type, s +ize => $Size };

      But that's why he should read perldoc perldsc.