in reply to Select query result sets

You can use fetchrow_arrayref as moritz suggested, or you can refer to the columns by name. I prefer using column names, as I find the code easier to read. Something like:

while (my $hr = $S->fetchrow_hashref) { my $cur_total = $hr->{Quantity} * $hr->{Unit_Price}; my $cur_tax = 0; $cur_tax = $cur_total * $hr->{Tax_Rate} if $hr->{Taxable} eq 'Y'; ... }

That's more readable (to me, at any rate) than a bunch of array subscripts that I have to remember. And if the query changes a bit, I don't need to worry about renumbering the indices.

...roboticus