# THE PRIMARY ISSUE BEGINS HERE #=========================================================== while (@row5 = $sth6->fetchrow_array) { $StatDate = date @row5[0]; $StatField = @row5[1]; $PctClosed = @row5[2]; $c++; push (@DataDate, $StatDate); push (@DataPct, $PctClosed); } #this right curly bracket ends the group of statements that are run once per each user } @data = ( [@DataDate], [@DataPct] ); #Creating the Graph $graph1 = GD::Graph::lines->new(1024, 768); $graph1->set( x_label => 'Date', y_label => '% Closed', title => "$groupname Vulnerability Tickets Closed", y_max_value => 100, y_tick_number => 10, x_label_skip => 7 ) or die $graph->error; $graph1->set( dclrs => [ qw(black dblue gold dgreen dred dpurple lorange dpink marine cyan dbrown lgray lblue lyellow dyellow lgreen lred lpurple pink ) ] ); $graph1->set( line_types => [1, 3] ); $graph1->set_legend($longname); my $gd = $graph1->plot(\@data) or die $graph1->error; open (IMG, ">>./$groupname.jpg"); binmode IMG; print IMG $gd->png; close IMG; {Email Statement} } #printing the data output to the html files in the host folder. These backups can help with debugging issues, as well as insuring that data is outputting correctly if email is being problematic print RPT "$output"; #this right curly bracket ends the group of statements that are run once for each group }