I am using Tex Live and Strawberry Perl installation on Windows 10. My ultimate goal was to get LaTeX to retrieve data from a spreadsheet, as shown in this old response. However, at this point I am trying to get Perl code using an additional module to work in perltex. When attempting to use a module in perltex

! Package perltex Error: Can't locate Excel/Writer/XLSX.pm in @INC (you may need to 
install the Excel::Writer::XLSX module) (@INC contains:
 E:/Programmdateien /texlive/2019/tlpkg/tlperl/lib 
 E:/programmdateien/texlive/2019/tlpkg/tlperl/lib) BEGIN failed--compilation 
aborted at (eval 13) line 6.
(perltex)                .

The modules are indeed installed properly. I know this because I can run the Perl code just fine with the desired outcome. The issue only occurs when trying to build using perltex.

  • Try in a local texmf.cnf TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL = 1. Dec 9, 2019 at 22:26
  • @UlrikeFischer That worked! Just before checking this question I had got it working by manually copying the contents of /Strawberry/perl to texlive/2019/tlpkg/tlperl. Does your fix just bypasses whatever I have in the mentioned texlive folder and finds my installation of Perl? If so, that is great because then I won't have to copy over my perl installation everything I install a module. Thank you so much for the help! Dec 9, 2019 at 22:35

1 Answer 1


Add to a local texmf.cnf


From the texmf.cnf documentation:

% This variable is specific to Windows.  It must be set to 0 or 1.  The
% default is 0.  Setting it to 1 tells the Windows script wrappers to
% use an already installed Perl interpreter if one is found on the
% search path, in preference to the Perl shipped with TeX Live.  Thus,
% it may be useful if you both (a) installed a full Perl distribution
% for general use, and (b) need to run Perl programs from TL that use
% additional modules we don't provide.  The TL Perl does provide all the
% standard Perl modules.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .