my (@h,@c); push @h, $_->{'hour'} foreach(@data); push @c, $_->{'count'} foreach(@data); my $new = [ \@h, \@c];