Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Perfect now!

by Andre_br (Pilgrim)
on Jan 22, 2005 at 19:35 UTC ( #424263=note: print w/replies, xml ) Need Help??


in reply to Re: Spreadsheet::ParseExcel vs alternative Cell Handler
in thread Spreadsheet::ParseExcel vs alternative Cell Handler

Hey John,

Thanks a lot for the help. Itīs working just perfect now. The only complain is not mine. Itīs Perlīs, that keeps saying all the time:

"Variable "$prev_col" will not stay shared at methods.cgi line 524. Variable "$prev_row" will not stay shared at methods.cgi line 524".

This .cgi is an auxiliar script where Iīve put our code. I call it, as usual, with "require methods.cgi" and call the sub parse_xls() with two arguments - the names of the $infile and $outfile. The conversion is running smoothly, (even with the 15k lines file it was crashing before your cell handler! Great!) but Perl is now complaining with this message every time I run the code. I thought putting a "return 1" would calm down Perl, I say, tell her I am not worried about these variables staying shared, but it didnīt change anything.

Any ideas?

Thanks!

André

Replies are listed 'Best First'.
Re: Perfect now!
by Errto (Vicar) on Jan 22, 2005 at 21:33 UTC
    This is one of Perl's stranger messages, but it is a common one. I assume one of the following is true
    • You are requireing this code from within the body of a subroutine in your main code
    • You are running it with mod_perl under Apache::Registry
    The result is that you are declaring a nested subroutine within another one, and the inner sub accesses a lexical variable declared in the outer one. This is a bad thing, because Perl will not be able to figure out which "instance" of that lexical variable the inner sub should be working with when you call it. Solutions to this problem are explained here.
      Hey, Errto.

      Thatīs the first one, in fact! Thanks for the help!

      André

Re: Perfect now!
by Tanktalus (Canon) on Jan 22, 2005 at 20:31 UTC

    Checking out perldoc perldiag can be really handy for these. As you don't have 524 lines of code here, I can't really be sure what it's referring to, but I find the diagnostic info to be incredibly useful. So useful that our coding standards say "use diagnostics" must be in our perl code, up with "use strict" and "use warnings".

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2021-09-25 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?