ok The writing is going fine now but the close still gets the error and the 0 byte file is still created. What I don't understand is that if the workbook object is destroyed prior to close, then I should get an error on the set_properties, correct? Thanks
$csv = Text::CSV_XS-> new (\%csv) or die "Problem creating new CSV obj +ect".Text::CSV_XS->error_diag (); my $csv_file = @ARGV && -f $ARGV[0] ? $ARGV[0]: "csv2excel"; # ge +t csv file name + + my $wbk = Excel::Writer::XLSX->new (my $outfile = get_outfile($csv_fil +e)) or die "Problems creating new Excel file: $!" unless defined $wbk +; + $properties{'title'} ||= $opt_title; + + + read_row(open_csv()); $wbk->set_properties(%properties); + + print Dumper($wbk->set_properties(%properties)); + + + $wbk->close;
with diagnostics gets
$VAR1 = { 'created' => [ 49, 4, 19, 15, 10, '114', 6, 318, 0 ], 'category' => '', 'title' => 'mytitle', 'company' => '', 'status' => '', 'keywords' => '', 'comments' => '', 'author' => '', 'manager' => '', 'subject' => '' }; Can't call method "get_xf_index" on unblessed reference at /usr/share/perl5/site_perl/Excel/Writer/XLSX/Worksheet.pm line + 6946 (#4) (F) A method call must know in what package it's supposed to run. + It ordinarily finds this out from the object reference you supply, bu +t you didn't supply an object reference in this case. A reference isn't + an object reference until it has been blessed. See perlobj. Uncaught exception from user code: Can't call method "get_xf_index" on unblessed reference at /us +r/share/perl5/site_perl/Excel/Writer/XLSX/Worksheet.pm line 6946. Excel::Writer::XLSX::Worksheet::_write_cell(Excel::Writer::XLS +X::Worksheet=HASH(0x3f9ffd0), 0, 0, ARRAY(0x3fa0570)) called at /usr/ +share/perl5/site_perl/Excel/Writer/XLSX/Worksheet.pm line 6685 Excel::Writer::XLSX::Worksheet::_write_rows(Excel::Writer::XLS +X::Worksheet=HASH(0x3f9ffd0)) called at /usr/share/perl5/site_perl/Ex +cel/Writer/XLSX/Worksheet.pm line 6600 Excel::Writer::XLSX::Worksheet::_write_sheet_data(Excel::Write +r::XLSX::Worksheet=HASH(0x3f9ffd0)) called at /usr/share/perl5/site_p +erl/Excel/Writer/XLSX/Worksheet.pm line 296 Excel::Writer::XLSX::Worksheet::_assemble_xml_file(Excel::Writ +er::XLSX::Worksheet=HASH(0x3f9ffd0)) called at /usr/share/perl5/site_ +perl/Excel/Writer/XLSX/Package/Packager.pm line 191 Excel::Writer::XLSX::Package::Packager::_write_worksheet_files +(Excel::Writer::XLSX::Package::Packager=HASH(0x2db7690)) called at /u +sr/share/perl5/site_perl/Excel/Writer/XLSX/Package/Packager.pm line 1 +28 Excel::Writer::XLSX::Package::Packager::_create_package(Excel: +:Writer::XLSX::Package::Packager=HASH(0x2db7690)) called at /usr/shar +e/perl5/site_perl/Excel/Writer/XLSX/Workbook.pm line 936 Excel::Writer::XLSX::Workbook::_store_workbook(Excel::Writer:: +XLSX=HASH(0x3f971c0)) called at /usr/share/perl5/site_perl/Excel/Writ +er/XLSX/Workbook.pm line 245 Excel::Writer::XLSX::Workbook::close(Excel::Writer::XLSX=HASH( +0x3f971c0)) called at /home/larry/perl/test/csv2excel.pl line 85 shell returned 25

In reply to Re: Excel::Writer::XLSX 0 byte outfile by doc1623
in thread Excel::Writer::XLSX 0 byte outfile by doc1623

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.