title: perl excel parse and modify the same worksheet
body: <p>I need to compare my XLS file with another one and modify the first (some cells) one accordingly.
  I need to do it crossplatform so I use Spreadsheet::ParseExcel::SaveParser</p>
  
  <p>Here is the subroutine I have so far</p>
  
  <pre><code>sub find_occurrences
  {
  my $xlsname   = $_[0];
  my $pattern   = $_[1];
  my $parser    = Spreadsheet::ParseExcel::SaveParser-&gt;new();
  my $workbook  = $parser-&gt;parse($xlsname);
  my $worksheet = $workbook-&gt;worksheet(0) || die("$@$!");
  my ( $row_min, $row_max ) = $worksheet-&gt;row_range();   
  for my $row ( 0 .. $row_max ) {         
      $cell = $worksheet-&gt;get_cell( $row, 1 );
      next if (!$cell);    
      if($cell-&gt;value() =~ m/$pattern/i )
      {
          print "Order found ",$cell-&gt;value(),"\n";   
          $worksheet-&gt;AddCell( $row, 1, "Shop" );     
      }       
  
  }
  }
  </code></pre>
  
  <p><a href="http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel/lib/Spreadsheet/ParseExcel/SaveParser.pm" rel="nofollow">http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel/lib/Spreadsheet/ParseExcel/SaveParser.pm</a></p>
  
  <p>Seems like example, bu I got this error:
  Can't locate object method "AddCell" via package "Spreadsheet::ParseExcel::Worksheet" at ./test.pl line 153.</p>
  
  <p>It is this one line</p>
  
  <p>$worksheet->AddCell( $row, 1, "Shop" ); </p>
  
  <p>I tried even add</p>
  
  <pre><code>use Spreadsheet::ParseExcel::Worksheet;
  use Spreadsheet::ParseExcel::Workbook;
  </code></pre>
  
  <p>I'm new to perl and i wasn't able to google something helpfull.</p>