Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Spreadsheet:Parse Excel problem

by jasonk (Parson)
on Apr 13, 2008 at 17:52 UTC ( [id://680129]=note: print w/replies, xml ) Need Help??


in reply to Spreadsheet:Parse Excel problem

I don't deal with excel much, but the error message itself is pretty simple, and is explained rather clearly in perldiag...

You tried to reference a substr() that pointed outside of a string. That is, the absolute value of the offset was larger than the length of the string.

So basically you get this message as a warning if you try to do something like:

my $string = "foobar"; my $letter = substr( $string, 42, 1 );

It's also a fatal error if you try and do that while using substr as an lvalue (as in my $x = substr( $string, 42, 1 );).


www.jasonkohles.com
We're not surrounded, we're in a target-rich environment!

Replies are listed 'Best First'.
Re^2: Spreadsheet:Parse Excel problem
by Not_a_Number (Prior) on Apr 13, 2008 at 18:57 UTC
    ...the error message itself is pretty simple

    Indeed it is. But I'm not sure how this observation helps the OP. Lines 1848-1850 of SpreadSheet::ParseExcel are:

    for(my $i = ($iDiff/2); $i>=1;$i--) { substr($sWk, $i+1, 0) = "\x00"; }

    Looks like a bug in the module to me, unless svar is doing something very strange when using it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://680129]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-19 07:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found