in reply to Re: Variables as a variable name... (I know you shouldn't but...)
in thread Variables as a variable name... (I know you shouldn't but...)
I guess you meant the inner while loop?
while (my $data = $sth->fetchrow_hashref()) { # %$data is now a hash. # keys are the column's names # values are the column's values while (my($k, $v)= each %$data) { # Now I loop over each column-value pair push( @{$results{$k}}, $v ); # pushing into the results' hashes all the values. # So $result{'canning'} is a reference to an array # for all the canning-values etc.pp. } }
|
|---|