in reply to Re^2: Problem passing GD image objectin thread Problem passing GD image object
You would need to pass a reference to the object then update the referenced value:
plot (\$g); ... $$graphimage = $graph->plot(\@data) or die $graph->error; [download]