Question : Another perl spreadsheet problem -- Why is this not running?

Hi guys,

There is one more problem I am stuck upon.

Why is this code not running?  for the attached excel...it is entering the else part of the loop.
---------------------------------------------------------------
#! /usr/perl5/bin/perl5.10 -w

use warnings;
use Spreadsheet::ParseExcel;
use strict;
use IO::Scalar;
use Data::Dumper;

my $run_var = "OTCOptionsMVCalc";

#shift;
#"OTCOptionsMVCal";
print "The run variable is $run_var" . "\n";
my $CFP = "/ms/user/s/sayantag/";

#shift;
#"/ms/user/s/sayantag/";
print "CFP variable is $CFP" . "\n";

my $xls_parser   = Spreadsheet::ParseExcel->new();
my $xls_workbook = $xls_parser->parse($CFP . "Demo_Calc_ETL_Dep5.xls");
my $xls_worksheet;


for  $xls_worksheet ( $xls_workbook->worksheets() ) {
#print "xyb";
my ( $row_min, $row_max ) = $xls_worksheet->row_range();
my ( $col_min, $col_max ) = $xls_worksheet->col_range();

 for my $row ( $row_min .. $row_max ) {##First for##
 for my $col ( $col_min .. $col_max ) {##Second for##
   my $cell = $xls_worksheet->get_cell( $row, $col );
     if ($col==0 && $row!=0 && ($xls_worksheet->get_cell($row, 0)->value eq "$run_var" ))  {
       print "The calc name is ", $xls_worksheet->get_cell($row, 0)->value;
       print "\n\n Calc Name correct\n\n;";
       system("/ms/dist/perl5/bin/perl5.10", "/ms/user/s/sayantag/Dependency_Tree.pl", $run_var, $CFP);
       }
     else {
       print "\n\nCalc Name Incorrect. Pls enter Calc Name correctly.\n\n";
       exit(1);
          }
       }
     }
   }
--------------------------------------------------------------------------
Attachments:
 
Attached spreadsheet to be parsed
 

Answer : Another perl spreadsheet problem -- Why is this not running?

10.5.+ is Leopard and
10.6.+ is Snow Leopard.

Check if you have the rights to a free Snow Leopard. You need an install disk to install Snow Leopard.
If not, it's not that expensive (compared to Windows at least).

It's easy to upgrade to SL so don't let this be in your way to become a developer.
Random Solutions  
 
programming4us programming4us