Thanks for the detailed comments. Please see my response below

Does your require line in main.pl use the full path to config.pl? I may be wrong, but I believe it should.

Comment:This part is extracted from a working project. For simplicity I gave you the piece of code that is broken. The path is fine

From what directory do you execute main.pl?

Comment:Both the scripts are in the same directory and I execute the code from the same directory

Please clarify your statement about using my <$var names>. Do you mean you're not using the config.pl and declaring my $workbook and my $worksheet in main.pl or something else?

Comments: Yes you are right I am not using the config.pl and instead declaring within main.pl. Sorry I was saving space in the initial post but ended up not giving too many details.

Since the code you've shown matches what's in the doc for my copy of S::WE (with the minor exception -- at line 15 -- of providing "0" values directly instead of by assigning "0" values to $col and $row), the possibilities include: Borked installs for both copies (you do have two, right?) of S:WE (a longshot, IMO) Something you haven't shown/told us (see my prior questions)

You might also want to look at lines around 1545-1546 in Workbook.pm to see if that section of the code provides any clues.

I checked the code and it breaks in these statements next unless $sheet->{_sheet_type} == 0x0000; next unless $sheet->_prepare_images(); I tried to print these two values and it is '0' both while using config.pl and while using the 'my variable'.

Update: And why, except for the sake of a learning experience, are you using a separate config.pl merely to declare two stock variables? That seems to me more than just a few degrees off vertical; an unnecessary bit of complexity or mis-direction.

Comment: I have a bigger working project and I am just introducing the spread sheet into it. So I need the global variable working since it will be used by other files and other processes also which will have access to the config file.


In reply to Re^4: Global variables issue in spreadsheets by syniperl
in thread Global variables issue in spreadsheets by syniperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.