while($logfile = shift) { push @data_sets, ({"type" => "file"}, $logfile); } gnuplot({"title" => "foo"}, \@data_sets);