The following leaves out a lot of detail. I usually either use text files or MySQL or PostgreSQL, so I am not up to speed on the Win32::OBDC SQL usage. But, maybe this will illustrate the flow a little. There is a good book on this stuff, 'Programming the Perl DBI' by Alligator Descarte and Tim Bunce (I think) published by OReilly. I think it is about $35(US) and is well worth the price, if you are going to be playing Database games with Perl.
HTH
#!perl
use CGI;
use Win32::ODBC;
$cgi = new CGI;
print $cgi->header;
print $cgi->start_html;
# try to retreive a search_term
$term = $cgi->param('search_term');
if ($term)
{
# establish a connection to the ODBC data source
$db = new Win32::ODBC("DSN=Your_ODBC_Data_Source;UID=your_uid;PWD=your_password"
or die Win32::ODBC::Error();
# do your sql executes/fetches
# print output to the browser.
# sorry, I don't have an example of doing this handy.
# close the database connection
if ($db) { $db->Close(); }
}
else
{
print "<p>Sorry, no search term submitted</p>\n";
}
# finish HTML output
print $cgi->end_html;
keep the rudder amid ship and beware the odd typo