And if you want to access a single element of an array, better write that as $depts[0] instead of @depts[0].my @names = qw[Center Div Dept]; my %orgs; foreach my $name (@names) { $orgs{$name} = $dbh->prepare("SELECT DISTINCT $name FROM People") +or die; $orgs{$name}->execute or die; }
In reply to Re: Looping over multiple queries
by JavaFan
in thread Looping over multiple queries
by Mad_Mac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |