in reply to How can I use the value of a scalar as the name of an array variable?

An alternative method is to use eval. In the while loop, try something like this in place of the bare push:
eval "push \@$category, $item;";
  • Comment on Re: How can I use the value of a scalar as the name of an array variable?
  • Download Code