#!/usr/bin/perl use strict; use POSIX qw(floor); my $resultFile = $ARGV[0]; open(RESULT, "$resultFile"); my @lines = ; my $variables = $lines[1]; my $rowCounter = 0; my $columnCounter = 0; while ($variables != "") { $variables =~ s/([\-0-9]+)//; if ($1 > 0) { my $value = $1 % 9; if ($value == 0) { $value = 9; } print($value); $columnCounter = $columnCounter + 1; if (($columnCounter % 3) == 0) { print(' '); } if ($columnCounter == 9) { print("\n"); $columnCounter = 0; $rowCounter = $rowCounter + 1; if (($rowCounter % 3) == 0) { print("\n"); } } } }