Subject: | illegal division by zero at GD/Text.pm line 507 |
perl, is v5.8.0 built from source
Linux is a custom built 2.4.19 with debian woody
the machine is a dual pIII 1133mhz
the problem occurs only when the script is run as cgi (mod_perl 1.27, apache 1.3.27)
regards m
----------->8-------------------------------------------
#!/usr/bin/perl -w
use strict;
use GD::Graph::lines;
use GD::Text;
print "content-type:image/png\n\n";
use vars qw($graph); undef($graph);
my $fontdir = "/usr/local/share/fonts";
my @x = (0 .. 4); my @y = (0 .. 4);
$graph = GD::Graph::lines->new(800, 500);
$graph->set( x_label => 'x label',
title => "title");
GD::Text->font_path($fontdir);
$graph->set_values_font("trebuc.ttf", 10);
$graph->set_title_font("trebuc.ttf", 20);
$graph->set_x_axis_font("trebuc.ttf", 10);
$graph->set_y_axis_font("trebuc.ttf", 10);
my @draw = (\@x,\@y);
my $gd = $graph->plot(\@draw);
print $gd->png;
----------->8-------------------------------------------