#!/usr/bin/perl -s -w use Chart::Clicker; use Chart::Clicker::Data::Series; use Chart::Clicker::Data::DataSet; $| = 1; sub mysub { ($x, $y) = @_; my $chart = Chart::Clicker->new; my @x_copy = @$x; my @y_copy = @$y; my $series = Chart::Clicker::Data::Series->new( keys => $x, # if I use \@x_copy and values => $y, # \@y_copy here instead, there is no problem ); my $dataset = Chart::Clicker::Data::DataSet->new( series => [ $series ], ); $chart->add_to_datasets($dataset); $chart->write_output('test.png'); } my @x_axis; my %a_hash; for (my $t=0;$t<200;$t++){ $x_axis[$t] = $t*10; @{$a_hash{abc}}[$t] = int(rand(100)); } for (my $x=0;$x<10000;$x++) { &mysub(\@x_axis, \@{$a_hash{abc}}); print "."; }