in reply to using GD::graph:lines

You seem to change the name from $graph to $my_graph in the middle of the program.

use strict would give you a better error description.