从excel中读取数据,放到一个hash中

从excel中读取数据,放到一个hash中
这是逐个单元格内容格读取的,不知道有没有方法一次把整个excel 表读入
sub Read_Excel_file
{
my $file="$MW{root_folder}bom.xls";
$Win32::OLE::Warn = 3;                
my $excel= Win32::OLE->GetActiveObject('Excel.Application')
      || Win32::OLE->new('Excel.Application');
$excel->{'Visible'} =1;   
my $workbook=$excel->Workbooks->open("$file");  

my %RangeVal=();
my $osheet=$workbook->worksheets(2);
$osheet->Activate; 
my ($lastrow,$lastcoli,$row,$col); 
   
$lastrow = 123;
$lastcoli= 16;
  
####Read BOM information from excel file-------------------------------- 
my $n=0;
$row=0;
while($row<$lastrow){    
      $row++;
      $col=0;  
      while ($col<$lastcoli){
      $col++; 
      $n++;
      if(defined($osheet->cells($row,$col)->Text)){
        $RangeVal{$n}=$osheet->cells($row,$col)->Text;    
       }else{
        $RangeVal{$n}="NA";        
       }
    }  
  }
return %RangeVal;
$workbook->close; 
$excel->Quit;
}