Why doesn't this work?
Posted in 1998
Topics: General Discussion
I am attempting to run a Perl CGI script that reads the contents of an
Informix table. In attempting to return the rows of the column it contains
into a dropdown menu box. I get
the following error:
syntax error at populate.pl line 51, near "my"
Not enough arguments for values at populate.pl line 70, near "values ="
I don't know why. Any of you Perl users have a clue?
Thanks for your help.
Dave
#################################
# below is referenced error line 51
my $query =<<EndOfQuery;
select *
from $tableEndOfQuery
my $cursor = $dbh->prepare($query);
$cursor = $dbh->prepare($query);
$cursor->execute;
$cursor->bind_columns(undef, \\($name, $value));
while ($cursor->fetchrow_arrayref) {
push(@array, $name);
$hash{$name} = $value;
}
$cursor->finish;
# below is referenced error line 70
print header, popup_menu(-name => 'popup', -values = [@array], -labels =>
{%hash});
$dbh->disconnect();
print $form->endform();
print $form->end_html();
exit (0);