Are you certain you don't want:@{$tbls{'12p'}} = [ 't72', 't73', 't74', 't75', 't76', 't77' ];
In addition, you can clean up your code considerably with the qw operator, eg.:$tbls{'12p'} = [ 't72', 't73', 't74', 't75', 't76', 't77' ];
$tbls{'12p'} = [ qw/ t72 t73 t74 t75 t76 t77 / ];
Are you running with use strict? If not, you probably should be.for $b (0 .. $#price) { ...
Update: One more thing--looping over indices is rarely needed, and makes for ugly code. I think your loops should be more like:
This saves you the mental overhead of having to process all those array lookups.for my $price (@price) { $sql = 'SELECT respondent FROM'; for my $table (@{$tbls{$price}}) { ... } }
In reply to Re: Mixing up indices in multidimensional hash
by trammell
in thread Mixing up indices in multidimensional hash
by punch_card_don
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |