my @compile=param ('compile'); my $version = "whatever"; my $dbh=DBI->connect($dsn,$user,$password,) or die "Error $DBI::errstr connecting to $dsn"; my $sth=$dbh->prepare(qq{ SELECT mycolumn FROM ddts WHERE `Stat`= ? AND `Project`= ? AND `Version`= ? }); $sth->execute("T", "Def", $version); print ""; while (my ($identifier) = $sth->fetchrow_array ) { foreach my $elem (@compile) { if ($elem eq $identifier) { print ""; } } } print "
$identifier
";