#!C:/perl/bin/perl.exe use CGI::Carp qw(fatalsToBrowser); use CGI; $query = new CGI; print $query->header; print $query->start_html(-title=>'Fraley Scatterplot Demo'); print " "; #-------Start Marie print "
"; open(INFO, "$ENV{'DOCUMENT_ROOT_OLD'}/www/relationshipsresearch.com/P593/rawdata 3_28_10.txt"); @data = ; close(INFO); #------Create array x------ $nx = 0; foreach $key (@data){ @a=split(/,/,$key); push @arrayx, $a[68]; $nx = $nx + 1; } #------Create array y------ $ny = 0; foreach $key (@data){ @a=split(/,/,$key); push @arrayy, $a[70]; $ny = $ny + 1; } #----------End Marie print "This is an example of a scatterplot in which the data themselves exist in Perl-generated arrays. The trick is to translate the Perl representation of the array data into a format that conforms to the display jquery/flot wants to use. We do so with a loop that designed to extract the array data in Perl and 'format' it in a way that dumps it into the javascript code being sent to the user's browswer.

"; print "
"; print ""; print $query->end_html;