punch_card_don has asked for the wisdom of the Perl Monks concerning the following question:
Need a fresh pair of eyes to point out what idiotic error I have in this syntax:
The execute produces an error that points to a syntax error "near '${$tbls{$price$a}}$i' " but I don't see it.@price = ('12p', '18p'); @{$tbls{'12p'}} = [ 't72', 't73', 't74', 't75', 't76', 't77' ]; @{$bases_tbls{'18p'}} = [ 't73', 't74', 't75', 't76', 't77' ]; for $b (0 .. $#price) { $sql = 'SELECT respondent FROM'; for $i (0 .. $#{$tbls{$price[$a]}}) { $sql = $sql.' ${$tbls{$price[$a]}}[$i];'; $sta = $dbh -> prepare($sql); $sta -> execute() or die("Could not execute!" . $sta->errstr() +); ... a bunch of stuff ... } }
Thanks.
update - last sentence to fix inconsistency pointed out by DragonChild.
Forget that fear of gravity,
Get a little savagery in your life.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mixing up indices in multidimensional hash
by trammell (Priest) on Feb 16, 2005 at 19:39 UTC | |
by Tanktalus (Canon) on Feb 16, 2005 at 19:46 UTC | |
by punch_card_don (Curate) on Feb 16, 2005 at 19:59 UTC | |
|
Re: Mixing up indices in multidimensional hash
by dragonchild (Archbishop) on Feb 16, 2005 at 19:26 UTC | |
|
Re: Mixing up indices in multidimensional hash
by holli (Abbot) on Feb 16, 2005 at 19:21 UTC | |
|
Re: Mixing up indices in multidimensional hash
by RazorbladeBidet (Friar) on Feb 16, 2005 at 19:58 UTC | |
by punch_card_don (Curate) on Feb 16, 2005 at 20:06 UTC | |
|
Re: Mixing up indices in multidimensional hash
by punch_card_don (Curate) on Feb 16, 2005 at 20:04 UTC |