if( !$rotate) { for( my $y = $y1 ; $y <= $y2 ; $y++) { for( my $x = $x1 ; $x <= $x2 ; $x++) { my $cell = $oWkS->{Cells}[$y][$x] ; #$output .= $cell->Value if(defined $cell); $output .= $cell->{Val} if(defined $cell); $output .= "," if( $x != $x2) ; } $output .= "\n" ; } } else { for( my $x = $x1 ; $x <= $x2 ; $x++) { for( my $y = $y1 ; $y <= $y2 ; $y++) { my $cell = $oWkS->{Cells}[$y][$x] ; #$output .= $cell->Value if(defined $cell); $output .= $cell->{Val} if(defined $cell); $output .= "," if( $y != $y2) ; } $output .= "\n" ; } }