Mercio has asked for the wisdom of the Perl Monks concerning the following question:
my $dbps = DBI->connect($dsn, 'root', 'password'); my $pgprep = $dbps->prepare('SELECT * FROM polls'); $pgprep->execute(); while (my $ref = $pgprep->fetchrow_hashref()) { my @labels = split(/#NEXT#/, $ref->{'choice'}); my @values = split(/#/, $ref->{'votes'}); my @data = (\@labels, \@values); open (TST, ">testtt.txt"); print TST $#values; print TST "\n".$#labels; close (TST); my $graph = new GD::Graph::bars3d(300,300); $graph->set( x_label => 'Poll Choices', y_label => 'Votes', title => $ref->{'title'}, dclrs => [ qw(orange blue green) ], borderclrs => [ qw(orange) ], x_labels_vertical => 1, labelclr => $param{'labelClr'}, axislabelclr => $param{'axisClr'}, textclr => $param{'titleClr'}, cycle_clrs => 1 ); $graph->set_title_font($param{'fontPath'}.$param{'titleFont'}.' +.ttf', $param{'titleSize'}); $graph->set_x_label_font($param{'fontPath'}.$param{'xLabelFont' +}.'.ttf', $param{'xLabelSize'}); $graph->set_x_axis_font($param{'fontPath'}.$param{'xAxisFont'}. +'.ttf', $param{'xAxisSize'}); $graph->set_y_label_font($param{'fontPath'}.$param{'yLabelFont' +}.'.ttf', $param{'yLabelSize'}); $graph->set_y_axis_font($param{'fontPath'}.$param{'yAxisFont'}. +'.ttf', $param{'yAxisSize'}); open (PNG, '>'.$param{'apacheRoot'}.$param{'graphImg'}.$ref->{' +id'}.'.png'); binmode PNG; print PNG $graph->plot(\@data)->png; #THis is where the eval e +rror is. close (PNG); print '<br> '; print '<table cellpadding=2 cellspacing=0 align="center" style= +"border: 0px; width: 88%;">'; print '<tr><td style="color: #3FBFE9; font-weight: bold;" style +="background-image: url(/jpg/layout/redback.jpg);" align="center">'.$ +ref->{'title'}.'</td></tr>'; print '<tr><td style="border: 1px solid #810306;" align="center +">'; print '<img src="'.$param{'absURI'}.$ref->{'id'}.'.png">'; print '</td></tr>'; print '</table>'; }
janitored by ybiC: Obscured db root password as courtesy to posting monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eval() issues.
by tachyon (Chancellor) on Jul 15, 2004 at 07:11 UTC | |
|
Re: eval() issues.
by mifflin (Curate) on Jul 15, 2004 at 05:36 UTC | |
|
Re: eval() issues.
by matija (Priest) on Jul 15, 2004 at 07:12 UTC | |
|
Re: eval() issues.
by Mercio (Scribe) on Jul 15, 2004 at 05:59 UTC | |
|
Re: eval() issues.
by Mercio (Scribe) on Jul 15, 2004 at 08:23 UTC |