mamba has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys,

I am new to perl, i have used Spreadsheet::ParseExcel, Spreadsheet::ParseExcel::SaveParser to parse and rearrange a Microsoft Excel Spreadsheet. After running the script the new rearranged file is created and all things seem to be in their expected places, but i get this message at the end of script execution.

Use of uninitialized value in numeric eq (==) at /usr/local/share/perl/5.10.1/Spreadsheet/ParseExcel/SaveParser/Workbook.pm line 213

Could this be due to some error in the code, i'll post the the code if you need it. thanks in advance

Replies are listed 'Best First'.
Re: SpreadSheet::ParseExcel Question
by ww (Archbishop) on Sep 05, 2011 at 11:55 UTC

    Yes, but you've given us insufficient info to be sure. However, that's one of two (obvious ... and who knows how many non-obvious) possibilities:

    1. "some error in the code...."
    2. using == instead of eq for a non-numeric comparison

    If your check (via Mark I eyeball, debug, print statements, etc) shows 2 is NOT the issue, then yes, posting some code would allow us to be more helpful. But, before posting, reduce your code to a minimal, runable example. Then be sure to also post at least a (small) sample of the data (perhaps as comma-delimited or tab-separated text).

Re: SpreadSheet::ParseExcel Question
by jmcnamara (Monsignor) on Sep 05, 2011 at 14:09 UTC

    If you are using the latest version of Spreadsheet::ParseExcel then the code giving the warning is as follows:

    ... # Print Gridlines if ( $oWkS->{PrintGrid} == 1 ) { $oWrS->hide_gridlines(0); } ...

    The PrintGrid option should be set to a default value on creation but perhaps there is a bug somewhere.

    If you like you can submit a bug report here. Follow the instructions on that page and submit the Excel file that you are having issues with. It won't be possible to debug it without the Excel file.

    Alternatively, you can just ignore the warning (mentally or programmatically) if it doesn't affect the end result.

    --
    John.

Re: SpreadSheet::ParseExcel Question
by Anonymous Monk on Sep 05, 2011 at 11:58 UTC