in reply to gd graphs

Your line:
my @data1=(@file1, @file2);
Will give you a single array with the contents of @file1 followed by @file2. To pass to GD::Graph, you need an array which contains references to the data you want to graph. That line should read
my @data1=([@file1], [@file2]);
Which will result in a graph with the contents of @file1 on the X-axis and @file2 on the Y-axis.