|
|
sybperl-l Archive
Up Prev Next
From: "Sheree Hemphill" <sah18 at po dot cwru dot edu>
Subject: RE: Using sybperl with cgi
Date: Feb 16 1999 7:04PM
> >>>>> "Sheree" == Sheree Hemphill writes:
>
> Sheree> Michael, Well, I am getting closer. I added the sybase
> Sheree> environment variable that you mentioned in your response,
> Sheree> however I am still getting a generic "Server Error" message on
> Sheree> this script. It doesn't like something about my foreach loop,
> Sheree> when I cycle through the results (again, this is identical to
> Sheree> the one that works as a shell script). I'm not sure if I'm
> Sheree> having a sybperl problem or a cgi problem at this point.
>
> The script looks fine at first sight.
>
> I suspect that something gets printed to stdout before the print
> header() call.
>
> Try moving the print header() to before the new Sybase::CTlib.
I changed my code to the following, but I get the same error.
1: #!/usr/local/bin/perl -w
2:
3: BEGIN {
4: $ENV{SYBASE} = "/usr/sybase";
5: }
6:
7: use CGI qw(:standard);
8: use Sybase::CTlib;
9:
10: my $TITLE;
11: $TITLE = "BIA Results";
12: print header, start_html($TITLE), h1($TITLE);
13:
14: my $dbh = new Sybase::CTlib 'sa', 'oracle8', 'helix';
15: $dbh->ct_sql("use htn");
16:
17: my $data = $dbh->ct_sql("select * from BIA");
18: my $row;
19:
20:
21: print hr;
22: print "";
23: print "test line\n";
24: foreach $row (@$data) {
25: print "$$row[0] - $$row[1] - $$row[2] - $$row[3] - $$row[4] - $$row[5] -
$$row[6] - 26: $$row[7] - $$row[8] - $$row[9] - $$row[10] - $$row[11]\n";
27: }
28: print "\n";
29: print hr;
30: print end_html;
If I comment out lines 24,25,&26, I do get the proper html page created &
returned. It just doesn't like how I am printing out the data results in
that foreach loop for some reason.
> Also, look in the server's error log for any messages.
I did check the error log & it said the following:
[16/Feb/1999:13:54:29] failure (15929): for host gene22797.GENE.CWRU.Edu
trying to GET /cgi-bin/sah18/biares3.cgi, cgieng_scan_headers reports: the
CGI program /var/www/htdocs/helix/cgi-bin/sah18/biares3.cgi did not produce
a valid header (name without value: got line "use of uninitialized value at
/var/www/htdocs/helix/cgi-bin/sah18/biares3.cgi line 25.")
I'm not clear oh what this is referring to.
If anyone else has any code snippets that do something similar, that could
serve as an example for me, I would greatly appreciate any suggestions you
might have.
Thank you again,
Sheree
|