in reply to How Do You Call a Non-Exported Function from a Module?

I've never used this module, but it looks like the documentation is wrong. If you look at the source, you'll see the the package is called Spreadsheet::XLSX::Utility2007, not Spreadsheet::XLSX::Utility. I think you should be able to use
use Spreadsheet::XLSX::Utility2007 qw(ExcelFmt ExcelLocaltime Localtim +eExcel xls2csv);

instead

Replies are listed 'Best First'.
Re^2: How Do You Call a Non-Exported Function from a Module?
by ikegami (Patriarch) on Apr 10, 2009 at 22:42 UTC
    Then you'd think that use Spreadsheet::XLSX::Utility ...; would give an error long before reaching the call to xls2csv.
      Yes I would.

      The synopsis for Spreadsheet::XLSX::Utility2007 starts wth

      use Spreadsheet::XLSX::Utility qw(ExcelFmt ExcelLocaltime LocaltimeExc +el);

      but the source code in http://cpansearch.perl.org/src/DMOW/Spreadsheet-XLSX-0.1/lib/Spreadsheet/XLSX/Utility2007.pm says

      package Spreadsheet::XLSX::Utility2007; #some stuff @EXPORT_OK = qw(ExcelFmt LocaltimeExcel ExcelLocaltime col2int int2col + sheetRef xls2csv);

      So, no, I don't know why the OP didn't get a "Can't locate ... in @INC" error :(

        Hi. Thanks to you all I have gotten a lot further. I changed the use statement to
        use Spreadsheet::XLSX::Utility2007;
        The xls2csv line is now just:
        my $sCsvTxt = xls2csv($sFileName, $sRegion, $iRotate);
        It doesn't error there anymore, so I guess that means it is exporting the xls2csv function, but now I get this error: "Tk::Error: Can't locate object method "new" via package "Spreadsheet::XLSX" at C :/strawberry/perl/site/lib/Spreadsheet/XLSX/Utility2007.pm line 952."

        I guess that means something is wrong with either Spreadsheet/XLSX.pm or Spreadsheet/XLSX/Utility2007.pm or am I missing something or is my installation corrupt?

        ***Update*** I used my Vanilla Perl installation instead of my Strawberry one by changing the Path in Windows. I then reinstalled Spreadsheet::XLSX and I'm still getting the same error. Is new perhaps a function being erroneously called as a method?