in reply to Different hashes?

Make the following change to your code:

-    %AllProducts = ($Category => [$ID, [$Name, $Type, $Size]]);
+    push @{ AllProducts{$Category} }, ( $ID, [$Name, $Type, $Size] );

what was wrong?

  1. redefined the hash while looping, thus overwriting it.
  2. made a new array reference instead of pushing onto it.

Cheers, Sören