in reply to Re^3: Parsing an SQL table using an array of hashes?
in thread Parsing an SQL table using an array of hashes?

Thank you very much -- this was very helpful. Two questions:

1. Can you explain this line for me please? I am just not sure I get it.

 push @y_plotdata,[@{$y_data{$cat}}];

2. I need to do the same thing, but reversed -- instead of category being the legend and dates on the x-axis, I need to do the categories on the a-axis, and the months in the legend.

I haven't started experimenting with it yet, but I wanted to say thanks for your help.

Replies are listed 'Best First'.
Re^5: Parsing an SQL table using an array of hashes?
by poj (Abbot) on Jul 01, 2013 at 06:31 UTC
    [@{$y_data{$cat}}] is a ref to a copy of the data for one $cat.

    It is equivalent to [ $y_data{$cat}[0],$y_data{$cat}[1],$y_data{$cat}[2],etc ]

    For a plot of all periods this would work equally as well

    push @y_plotdata,$y_data{$cat};
    poj