Problem with Spreadsheet::Read

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default Problem with Spreadsheet::Read

    I want to use the Spreadsheet::Read module to process an Excel
    spreadsheet. I'm also a Perl newbie (and have been so for several years!).

    Tentative tests have shown it to be working, but I'm getting the
    following error:

    Use of unitialsised value in hash element at
    /usr/local/share/perl/5.8.7/Spreadsheet/Read.pm at line 309.

    I've had a look at the offending line:

    $data[0]{sheet}{$sheet{label}} = $#data;

    I've had a fiddle with the line (I suspected the '$#data'), but I don't
    really know what I'm doing and nothing worked!

    I'd be grateful for any advice, please.

    Jim Ford
    Jim Ford Guest

  2. Similar Questions and Discussions

    1. Problem adding Excel Spreadsheet to Web Page
      One of my users has a problem when she tries to put an Excel spreadsheet into Contribute. She first gets a message that she "selected a large...
    2. ANN: Spreadsheet::Read 0.16
      The URL http://www.xs4all.nl/~hmbrand/Spreadsheet-Read-0.16.tgz has entered CPAN as file:...
    3. ANN: Spreadsheet::Read 0.15
      The URL http://www.xs4all.nl/~hmbrand/Spreadsheet-Read-0.15.tgz has entered CPAN as file:...
    4. Spreadsheet::ParseExcel : read cell-notes
      Is there any way to read the notes/comments attached to a cell using SpreadSheet::ParseExcel or a different module? I searched CPAN and google and...
    5. php read problem
      hi every1. i have a proble i have a flash movie where i load a variable into a textbox form a movie clip using...
  3. #2

    Default Re: Problem with Spreadsheet::Read

    Jim Ford wrote:
    > I want to use the Spreadsheet::Read module to process an Excel
    > spreadsheet. I'm also a Perl newbie (and have been so for several years!).
    >
    > Tentative tests have shown it to be working, but I'm getting the
    > following error:
    >
    > Use of unitialsised value in hash element at
    > /usr/local/share/perl/5.8.7/Spreadsheet/Read.pm at line 309.
    >
    > I've had a look at the offending line:
    >
    > $data[0]{sheet}{$sheet{label}} = $#data;
    >
    > I've had a fiddle with the line (I suspected the '$#data'), but I don't
    > really know what I'm doing and nothing worked!
    >
    > I'd be grateful for any advice, please.
    >
    > Jim Ford
    I believe the error means that $sheet{label} is undefined.

    Tom Wyant
    harryfmudd [AT] comcast [DOT] net Guest

  4. #3

    Default Re: Problem with Spreadsheet::Read

    In article <oDRhg.17093$x53.4012@newsfe1-win.ntli.net>, Jim Ford
    <jaford@watford53.freeserve.co.uk> wrote:
    > I want to use the Spreadsheet::Read module to process an Excel
    > spreadsheet. I'm also a Perl newbie (and have been so for several years!).
    >
    > Tentative tests have shown it to be working, but I'm getting the
    > following error:
    >
    > Use of unitialsised value in hash element at
    > /usr/local/share/perl/5.8.7/Spreadsheet/Read.pm at line 309.
    >
    > I've had a look at the offending line:
    >
    > $data[0]{sheet}{$sheet{label}} = $#data;
    >
    > I've had a fiddle with the line (I suspected the '$#data'), but I don't
    > really know what I'm doing and nothing worked!
    >
    > I'd be grateful for any advice, please.
    Spreadsheet::Read uses Spreadsheet::ParseExcel to read Excel
    spreadsheets. I have used Spreadsheet::ParseExcel successfully in the
    past to read Excel spreadsheets. You might try using the
    Spreadsheet::ParseExcel module directly and see if that works for you.
    Jim Gibson Guest

  5. #4

    Default Re: Problem with Spreadsheet::Read

    On Thu, 08 Jun 2006 18:19:25 +0200, Jim Gibson <jgibson@mail.arc.nasa.gov>
    wrote:
    > In article <oDRhg.17093$x53.4012@newsfe1-win.ntli.net>, Jim Ford
    > <jaford@watford53.freeserve.co.uk> wrote:
    >
    >> I want to use the Spreadsheet::Read module to process an Excel
    >> spreadsheet. I'm also a Perl newbie (and have been so for several
    >> years!).
    >>
    >> Tentative tests have shown it to be working, but I'm getting the
    >> following error:
    >>
    >> Use of unitialsised value in hash element at
    >> /usr/local/share/perl/5.8.7/Spreadsheet/Read.pm at line 309.
    >>
    >> I've had a look at the offending line:
    >>
    >> $data[0]{sheet}{$sheet{label}} = $#data;
    >>
    >> I've had a fiddle with the line (I suspected the '$#data'), but I don't
    >> really know what I'm doing and nothing worked!
    >>
    >> I'd be grateful for any advice, please.
    >
    > Spreadsheet::Read uses Spreadsheet::ParseExcel to read Excel
    > spreadsheets. I have used Spreadsheet::ParseExcel successfully in the
    > past to read Excel spreadsheets. You might try using the
    > Spreadsheet::ParseExcel module directly and see if that works for you.

    $#data cannot be undefined I think, but $sheet{label} could be if the sheet
    has no label at all (the text in the tab)

    You could make that code more safe:

    defined $sheet{label} or $data[0]{sheet}{$sheet{label}} = $#data;

    If the label is undefined, there is no use in storing the reverse
    reference. Could you try that?

    FWIW I've added that safety check in my local sources,
    so it will be in the next release (a bit different)

    Enjoy, Have FUN! H.Merijn
    H.Merijn Brand Guest

  6. #5

    Default Re: Problem with Spreadsheet::Read

    H.Merijn Brand wrote:
    > On Thu, 08 Jun 2006 18:19:25 +0200, Jim Gibson
    > <jgibson@mail.arc.nasa.gov> wrote:
    >
    >> In article <oDRhg.17093$x53.4012@newsfe1-win.ntli.net>, Jim Ford
    >> <jaford@watford53.freeserve.co.uk> wrote:
    >>
    >>> I want to use the Spreadsheet::Read module to process an Excel
    >>> spreadsheet. I'm also a Perl newbie (and have been so for several
    >>> years!).
    >>>
    >>> Tentative tests have shown it to be working, but I'm getting the
    >>> following error:
    >>>
    >>> Use of unitialsised value in hash element at
    >>> /usr/local/share/perl/5.8.7/Spreadsheet/Read.pm at line 309.
    >>>
    >>> I've had a look at the offending line:
    >>>
    >>> $data[0]{sheet}{$sheet{label}} = $#data;
    >>>
    >>> I've had a fiddle with the line (I suspected the '$#data'), but I don't
    >>> really know what I'm doing and nothing worked!
    >>>
    >>> I'd be grateful for any advice, please.
    >>
    >>
    >> Spreadsheet::Read uses Spreadsheet::ParseExcel to read Excel
    >> spreadsheets. I have used Spreadsheet::ParseExcel successfully in the
    >> past to read Excel spreadsheets. You might try using the
    >> Spreadsheet::ParseExcel module directly and see if that works for you.
    >
    >
    >
    > $#data cannot be undefined I think, but $sheet{label} could be if the sheet
    > has no label at all (the text in the tab)
    >
    > You could make that code more safe:
    >
    > defined $sheet{label} or $data[0]{sheet}{$sheet{label}} = $#data;
    >
    > If the label is undefined, there is no use in storing the reverse
    > reference. Could you try that?
    >
    > FWIW I've added that safety check in my local sources,
    > so it will be in the next release (a bit different)
    >
    > Enjoy, Have FUN! H.Merijn
    Thanks for the reply.

    There are some blank worksheets with the main one, labeled 'Sheet 2'
    ,'Sheet 3' etc.. I deleted them and the warning went away, but I then
    found that I couldn't read the data in a particular cell, even though
    the data was there and didn't look unusual (it was read as 'General').
    I've gone back to the original version of the spreadsheet and am
    ignoring the warning.

    Thanks for your help (and responding to my email).

    Jim Ford
    Jim Ford Guest

  7. #6

    Default Re: Problem with Spreadsheet::Read

    On Tue, 13 Jun 2006 10:52:42 +0200, Jim Ford
    <jaford@watford53.freeserve.co.uk> wrote:
    > H.Merijn Brand wrote:
    >> On Thu, 08 Jun 2006 18:19:25 +0200, Jim Gibson
    >> <jgibson@mail.arc.nasa.gov> wrote:
    >>>
    >>> Spreadsheet::Read uses Spreadsheet::ParseExcel to read Excel
    >>> spreadsheets. I have used Spreadsheet::ParseExcel successfully in the
    >>> past to read Excel spreadsheets. You might try using the
    >>> Spreadsheet::ParseExcel module directly and see if that works for you.
    >> $#data cannot be undefined I think, but $sheet{label} could be if
    >> the sheet
    >> has no label at all (the text in the tab)
    >> You could make that code more safe:
    >> defined $sheet{label} or $data[0]{sheet}{$sheet{label}} = $#data;
    >> If the label is undefined, there is no use in storing the reverse
    >> reference. Could you try that?
    >> FWIW I've added that safety check in my local sources,
    >> so it will be in the next release (a bit different)
    >> Enjoy, Have FUN! H.Merijn
    >
    > Thanks for the reply.
    >
    > There are some blank worksheets with the main one, labeled 'Sheet 2'
    > ,'Sheet 3' etc.. I deleted them and the warning went away, but I then
    > found that I couldn't read the data in a particular cell, even though
    > the data was there and didn't look unusual (it was read as 'General').
    > I've gone back to the original version of the spreadsheet and am
    > ignoring the warning.
    >
    > Thanks for your help (and responding to my email).
    my $ref = ReadData ("file.xls", debug => 9);

    could be helpful, as it should print about every action taken, and
    every data read.

    As I asked in my mail, can I please have that spreadsheet, so I can
    analyze?
    H.Merijn Brand Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139