In a message dated 4/12/2005 3:56:43 P.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> Hi all,
>
> I am working with GD::Graph and I am
retrieving some data from a DB and
> formatting the data into a string
that I can use for graphing.
> my @data = "">> My $myGraph
= GD::Graph::lines->new(400,300);
> ...
>
> The problem
is that my formatted string of data is not in the correct
> format and
returns an error. I check the string printed to the screen
> and it
looks like this:
>
> [-0.84,-0.83,-0.4,-0.39,-
>
0.39,1.16,2.38,4.49,7.08,10.07,13.14],
>
[1.09,0.47,-14.95,-47.63,-
>
5.75,30.19,21.07,37.63,57.18,84.63,118.59],
>
[0,0.06,-21.27,-59.79,-
>
11.11,22.26,12.67,15.25,10.79,6.58,4.52,4.05]
> Invalid data set: 0 at
c:\inetpub\wwwroot\trialmap\cgi-bin\eData.pl line
> 2106.
>
> >From my testing, the array needs the data to be either one line,
or 3
> lines separated by the brackets.
> I am assuming they are
return carriages, (but I am not sure why it is
> there) so I try this RE
to remove it, with no luck.
> $data1 =~/(\r)//g;
this a match, but not a substitution. try ``$data =~
s/\r//g;'' (capturing parentheses are not needed). also, the line
break may a newline rather than a carriage return: try \n in place of
\r.
>
> Any insights?
> Thanks
> David