for ($x=1; $x<10; $x++) { @anotherarray=(1,2,3,4,5); push @data, [ @anotherarray ]; } my $gd = $graph->plot(\@data) or die $graph->error;