# verbose: my @stats; # Initialize the 12 months: my $months = 12; for (0..$months-1) { $stats[$_] = []; # empty array at first }; my $month = 2; my $value = 300; push @{ $stats[ $month ] }, $value; my $nr = 2; print join ",", @{ $stats[ $nr ] };