for my $xls ( 'spreadsheet1.xls', 'spreadsheet2.xls' ){ my $book = $oExcel->Parse($xls); my $worksheet = $book->{Worksheet}->[0]; ## Give a name to both sheets if ($xls =~ /1/) { $namedsheet = $final->add_worksheet('First Sheet'); } elsif ($xls =~ /2/) { $namedsheet = $final->add_worksheet('Second Sheet'); } my $sheetf = $namedsheet; my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); for my $row ( $row_min .. $row_max ) { for my $col ( $col_min .. $col_max ) { my $cell = $worksheet->get_cell( $row, $col ); next unless $cell; $sheetf->write( $row , $col, $cell->unformatted ); } } }