in reply to Variables as a variable name... (I know you shouldn't but...)

To be honest, I don't quite understand your request.

You want to loop over your query results and push each column's value into a seperate array?

So the solution should be to push them into an Hash of Arrays (HoA) like this:

# untested my %results; while (my $data = $sth->fetchrow_hashref()) { while (my($k, $v)= each %$data) { push( @{$results{$k}}, $v ); } } # your dataplot should then go like this: @data_to_plot = ( [ @results{qw/dayofweek canning multipack quest/} ] +);

s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e