Figuring out exactly how and where an error message is coming from can be a challenge if the error gets triggered deep inside code that isn't your own, or even deep inside your own code, if you have reusable subroutines that get called in several places.

If your code is dying when you get this error, you might try placing the following line at the top of your script just below your use Carp::Assert. It forces a nice stack trace so you can see exactly what was calling what when your error got generated.

$SIG{__DIE__} = sub { Carp::confess unless $^S };

I find it helpful sometimes to comment and uncomment it. The Carp stack trace has a nasty habit of truncating messages so you can't always see the full error message. I'll run the code once with the above line commented to see the full message and then once again with it uncommented to see the stack trace that lead to the message.

And many thanks to the kind monk who suggested using Carp::confess in $SIG{__DIE__} to me a year or so ago in the cb - I wish I remember who you are because you saved me countless hours of debugging time since.


In reply to Re: Spreadsheet::WriteExcel error by ELISHEVA
in thread Spreadsheet::WriteExcel error by ag4ve

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.