I need to use Excel::Writer::XLSX for writer and Spreadsheet::XLSX for reader, but I didn't know how to use it

Start by reading the documentation for that modules.

I tried with the below script, but this one uses the old xls application, my files are xlsx.

Quick and dirty way: Convert XLSX to XLS, then use the old script, finally convert XLS back to XLSX.

I can feel that you will ask how to convert between XLS and XLSX. Well, let me give you a hint: Modern Excel can read and write old excel formats.

I appreciate your help.

I think you misspelled that. Did you mean "Write code for me"?

Perlmonks is not a code writing service. Use the quick and dirty hack, or start using your own brain. Yes, learning Perl takes time, like learning any other language.

You have an old script that uses the "wrong" modules. I know that at least some of the Spreadsheet::* modules intentionally have very similar, if not identical, APIs for handling XLS and XLSX. So start by simply replacing the XLS module names with the XLSX module names in the script. Start the script, look at the errors it gives you and try to fix them. You will very likely need the documentation for the XLS and XLSX modules, and you have to read the documentation.

When you reach the point where you can no longer find a way to fix an error, post the modified code and the error messages in this thread.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^5: Merging 2 xlsx files by afoken
in thread Merging 2 xlsx files by mnakkach

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.