$fileName = $_[0]; $fFnc = $_[1]; $logMsg = new LogMessage(); $logMsg->writeLog( $fFnc, "Reading $fileName \n" ); $FileData = ""; %FileHash = (); %source_headers = (); # For XLSX formats if( $fileName =~ /\.xlsx$/i ) { my $myConv = Text::Iconv->new ("utf-8", "windows-1251"); my %xlFileData = (); my $myBook = Spreadsheet::XLSX->new( "$fileName", $myConv ); if( $myBook ) { foreach my $sheet (@{$myBook->{Worksheet}}) { $sheet->{MaxRow} ||= $sheet->{MinRow}; foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { $sheet -> {MaxCol} ||= $sheet -> {MinCol}; foreach my $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) { my $cell = $sheet -> {Cells} [$row] [$col]; // At this place it gives incorrect result }