$sth=$dbh->prepare($sql); $sth->execute() || die "Could not execute SQL statement... maybe invalid syntax?"; #show the results of the regex query in a table print "
Search Results:
". ""; while (my @array = $sth->fetchrow_array()){ print ""; foreach my $elem (@array){ #search & display the first element in the array for the regex $searchTitle=$array[0]; if ($searchTitle=~/(?=.*pr\w{4}m)(?=(?=\w*w\w*)(?=\w*b\w*)\w+\b)/){ print "
"; print "$elem\n"; print ""; } } } print "
"; $sth->finish; $dbh->disconnect;