perl@1983 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have a Excel spreadsheet where in I have defined few variables and their values (a kind of configuration). I would like to read each variable name and initialize its value. I am new to Perl and was wondering what can be best approach to do that? Can it be taken into a hash at one go? Otherwise, I'll have to put if-else or switch statements as many times as there are variables, which I think would not be feasible in longer run. The format of Excel is: Cell A1 contains variable name Cell A2 contains its value Cell B1 contains another variable name Cell B2 contains its value and so on... Thanks in advance.

Replies are listed 'Best First'.
Re: Creating Hash from Excel 2007
by chilledham (Friar) on May 17, 2011 at 18:41 UTC
      Thank you everyone!! I am using Office 2007 Spreadsheet::XLSX module.
Re: Creating Hash from Excel 2007
by wind (Priest) on May 17, 2011 at 17:11 UTC

    Just use Spreadsheet::ParseExcel.

    Iterate on the cells assigning each row to a key/value pair in your configuration hash.

Re: Creating Hash from Excel 2007
by eff_i_g (Curate) on May 17, 2011 at 17:15 UTC