#!/usr/bin/perl use strict; use warnings; my $n_cols = 5; my @data = ('1'..'12'); print "
| ' . (join " | \n", (@data, (' ')x$n_cols)[0..$n_cols - 1]) . ' |
##
1
2
3
4
5
6
7
8
9
10
11
12