On Tue, Jun 19, 2001 at 07:09:40PM +0200, Christine Kluka wrote:
> Now the error that I get is: "xxx.cgi did not produce a valid header
> (name without value:got line "variable $i" is not imported at xxx.cgi
> line 65.") I need to declare the subroutine "row" in which the error is
> found to do a "fetchrow" later in the script, and I can't see an error
> in the subroutine itself. Help!
You've got use strict, but you forgot to declare the variable $i:
> sub row
> {
>
> $r = shift(@_);
> @r = @_;
> $nfields = $r->nfields;
> for ($i=0; $i<$nfields; $i++) {
> $fname = $r->fname($i);
> $r{$fname} = $r[$i];
> }
> return %r;
> }
Ronald