use DBI; use CGI; use CGI::Carp qw( fatalsToBrowser ); my $q = new CGI; print $q->header( -type=>"text/html", -charset=>"UTF-8" ), $q->start_html( -title => "myCrap.arg" ), $q->p("This is my thing!"); my ( $data_source, $database, $port, $user_id, $password ) = qw( "PIKACHU\NetSDK", "HarvestDay", "127.0.0.1:2433", "HarvestReader", "reader" ); my $conn_string = "driver={SQL Server}; Server=$data_source; tcpip=$port; Database=$database; UID=$user_id; PWD=$password;"; my $dbh = DBI->connect("dbi:ODBC:$conn_string") or die "Unable to connect: $DBI::errstr\n"; my $sth = $dbh->prepare("SELECT * from harvest") or die "Unable to prepare: $DBI::errstr\n"; $sth->execute; while ( my @row = $sth->fetchrow_array ) { foreach my $item ( @row ) { $q->p("$item || "); } } print $q->end_html;