in reply to Mixing up indices in multidimensional hash

OK, got it.

The problem was manifold.

First, DragonChild correctly pointed out that the original array declaration should have been

$bases_tbls{'18p'} = [ 't73', 't74', 't75', 't76', 't77' ];
Then, the line
$sql = 'SELECT respondent FROM';
was incorrectly placed. It should have been integrated into the loop, otherwise the line just got new items tacked onto it making a nonsensiscal sql command.

Finally, the right way to refer to the element was

$tbls{$price[$g]}[$i]
Thanks for the help, all. One of the few drawbacks of being an independent is the lack of other humans in the office to bounce problems off of.

Forget that fear of gravity,
Get a little savagery in your life.