Hi joelnackman,

If you read the documentation for write_row, you'll see that it generates the same return code as write, which is:

0 for success. -1 for insufficient number of arguments. -2 for row or column out of bounds. -3 for string too long.
So I believe you are incorrectly exiting with your code:
$worksheet->write_row($excelRow, 0, \@personData) or die "Write failed +: $!\n";
That is to say, try changing or to and in the above line, and that section of your code should work.  You don't need to check the value of "$!", because it's not a system call, which may thus be giving you misleading results.

When I ran it, after "doctoring" the @personData array to hold some valid values, I was getting the error Write Failed: Bad file descriptor, which is a red herring.  When the logic was changed to interpret zero as success (and I added a line workbook->close() immediately afterwords), the Excel spreadsheet correctly contained the data I had written.


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

In reply to Re: Excel File Problem by liverpole
in thread Excel File Problem by joelnackman

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.