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

Then you'd think that use Spreadsheet::XLSX::Utility ...; would give an error long before reaching the call to xls2csv.

Replies are listed 'Best First'.
Re^3: How Do You Call a Non-Exported Function from a Module?
by FunkyMonk (Bishop) on Apr 10, 2009 at 23:06 UTC
    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?