use 5.10.0; $_=join"+",map{$n=$_*10;sprintf" %-5s",$n%100||$n}1..22; s/ /-/g; # replace blanks with dashes s/-/|/; # make first dash into a pipe sign $_.='|'; # add pipe sign to the end say; __END__ |---10---+----20---+----30---+----40---+----50---+----60---+----70---+----80---+----90---+----100--+----10---+----20---+----30---+----40---+----50---+----60---+----70---+----80---+----90---+----200--+----10---+----20---|