On Mon, Apr 09, 2001 at 08:57:14PM -0700, Alex Daniloff wrote: ...
while(@row = $sth->fetchrow_array) { foreach $field(@row) { my @data = @row; }
At first glance I see one thing here that seems amiss. Whenever you use "my", that variable is only valid within the context of that block (i.e. it shouldn't be referenced beyond the enclosing "}"). This means that...
}
my $image = $graph->plot( \@data);
... this reference to @data is out-of-bounds. Perhaps sth more like this is what you had in mind?... while(@row = $sth->fetchrow_array) { foreach $field(@row) { my @data = @row; my $image = $graph->plot( \@data); print $q->header( -type => "image/png"); print $image->png; } } There may be other errors though. For instance, don't you want to do something with $field? Also, I'm just evaluating your perl code here and assuming your usage of the various objects is correct.