Ronald,
Thanks for your reply. I:
- declared $i=0; -- it still fails to import
I've tried various other things, like
- declaring $i as <STDIN>, then chomping it -- same result
- using code from
http://www.perl.com/pub/1999/10/DBI.html#About_Relational_Databases_Gener
for DBI->connect, but also using the code that I have -- got "method not
supported"
I"ll keep trying. In the meantime, any ideas are appreciated, thanks!
Christine
Ronald J Kimball wrote:
>
> 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