Solution for sudoku puzzle in Perl