use Math::Matrix; use Math::Roman qw( roman ); use File::Slurp qw( slurp ) ; my $sign = slurp( \*DATA ) ; my $year = roman( 1776 ); my $matrix = Math::Matrix->new( map [map roman($_), split '',$_], $year =~ /(...)(...)(...)/ ); for (@{ $matrix->transpose }) { my $copy = $sign; $copy =~ s/###/sprintf '%3d',$_/e for @$_; print "$copy\n"; } __DATA__ ### / \ / \ / \ ###-------###