say "month are @month"; month are ARRAY(0x1fa34e0) ARRAY(0x1fa3678) ARRAY(0x1fa41d0) ARRAY(0x1edd548) ARRAY(0x1edd5f0) ARRAY(0x1edd698) #### use Data::Dumper; say Dumper \@month; #### $VAR1 = [ [ undef, undef, undef, undef, undef, undef, 1 ], [ 2, 3, 4, 5, 6, 7, 8 ], [ 9, 10, 11, 12, 13, 14, 15 ], [ 16, 17, 18, 19, 20, 21, 22 ], [ 23, 24, 25, 26, 27, 28, 29 ], [ 30, undef, undef, undef, undef, undef, undef ] ]; #### foreach (@month) { say join " ", @$_; } #### ( undef, 2, 3, 10 ) #### ( ' ', ' 2 ', ' 3 ', '10 ') #### foreach (@month) { say map { if ($_) { # if the element is not undef sprintf "%2d ", $_; # format it so it takes 2 spaces, and add one space to it } else { # if the element is undef ' '; # replace it with 3 spaces } } @$_; } #### my $font = $pdf->ttfont('DejaVuSans.ttf');