Hi 

Firstly, for an excelent general perl list, try [EMAIL PROTECTED] It's not 
just for beginners.

Secondly, it looks like you're trying to access a field that isn't defined, 
possibly by running off the end of the row.

I've re-written (but not tested) the routine slightly more perlified.

See what you think.

while (my @row = $sth->fetchrow_array )
  {
  foreach my $field (shift @row) {
    if (! defined ($field) || (length($field) == 0))
      {
       # don't know why you do this cos
       # you're printing nothing here
        print $field;
      } else {
        print "\"$field\"";
      }
    if (@row) # fields left, stick in a comma
      {
      print ",";
      }
  }
  print ("\n");
  }
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to