Ummmmmm ... your post now looks nothing like my recollection of it from a few hours ago. (Perhaps my memory is letting me down.)
One of the nice things about being able to edit one's posts is that one can fix errors (eg typos, formatting) - but if you're going to move the goalposts by more than a kilometre or two, it's generally considered good etiquette to acknowledge that you have done so :-)
I don't have an answer to your question as it now stands - but it at least looks sane.
The following code produces the same error as you reported:
use warnings;
use strict;
my $x = foo;
print $x, "\n";
sub foo {return 42}
But the following code runs fine:
use warnings;
use strict;
my $x = foo();
print $x, "\n";
sub foo {return 42}
On the surface, it looks like it may be a bug in GDGraph, but it seems that no such bug has been reported ... perhaps it's something else. Answers to the following questions may help:
1) What version of perl do you have ?
2) What version of GD (the perl module) do you have ?
3) What version of the GDGraph module do you have ?
4) What version of gd (the C library) do you have ?
Cheers,
Rob