# Is it possible to use lmkclean arara rule on Windows?

If I run arara on Windows 10 with this file:

% arara: pdflatex
% arara: lmkclean
\documentclass{book}
\begin{document}
More \emph{ducks} into \LaTeX{}!
\end{document}


I get this error:

21 Jun 2017 08:24:45.123 INFO  CommandTrigger - Running 'LaTeXmKCleaner'.
21 Jun 2017 08:24:45.123 TRACE CommandTrigger - Command: latexmk -c "TeX_SE_arara_test.tex"
21 Jun 2017 08:24:45.780 TRACE CommandTrigger - Output logging:
21 Jun 2017 08:24:45.780 TRACE CommandTrigger - Can't locate Digest/MD5.pm in @INC (you may need to install the Digest::MD5 module) (@INC contains: C:/Program Files (x86)/LyX 2.2/Perl/lib .) at c:\texlive\2017\texmf-dist\scripts\latexmk\latexmk.pl line 137.
BEGIN failed--compilation aborted at c:\texlive\2017\texmf-dist\scripts\latexmk\latexmk.pl line 137.
C:\texlive\2017\bin\win32\runscript.tlu:708: command failed with exit code 2:
perl.exe c:\texlive\2017\texmf-dist\scripts\latexmk\latexmk.pl -c TeX_SE_arara_test.tex

21 Jun 2017 08:24:45.780 WARN  CommandTrigger - 'LaTeXmKCleaner' returned an error status.
21 Jun 2017 08:24:45.780 INFO  Arara - Done.


Even if I run latexmk in the terminal, I get the same error:

C:\Users\carla\OneDrive\Documenti\TeX_StackExchange>latexmk TeX_SE_arara_test.tex
Can't locate Digest/MD5.pm in @INC (you may need to install the Digest::MD5 module) (@INC contains: C:/Program Files (x86)/LyX 2.2/Perl/lib .) at c:\texlive\2017\texmf-dist\scripts\latexmk\latexmk.pl line 137.
BEGIN failed--compilation aborted at c:\texlive\2017\texmf-dist\scripts\latexmk\latexmk.pl line 137.
C:\texlive\2017\bin\win32\runscript.tlu:708: command failed with exit code 2:
perl.exe c:\texlive\2017\texmf-dist\scripts\latexmk\latexmk.pl TeX_SE_arara_test.tex

• This looks like you're missing the necessary perl module(s) – cmhughes Jun 21 '17 at 6:54
• @cmhughes Could you suggest to me how to get them? (I hardly know what perl is). – CarLaTeX Jun 21 '17 at 7:06
• @cmhughes Isn't it more besause somehow it is picking up a different Perl than then one coming with TL17? latexmk cannot run without MD5 and if other Windows users was missing it we would have heard. This @INC contains: C:/Program Files (x86)/LyX 2.2/Perl/lib . looks really strange – daleif Jun 21 '17 at 7:36
• @CarLaTeX my guess is that it is picking up the wrong Perl, you have some Perl from LyX. Do you use LyX? If not remove that part from the PATH. LaTeXmk is picking up Perl from your PATH and if you have more than one, it may get confused and pick up the wrong one. I have no idea what LyX needs Perl for, – daleif Jun 21 '17 at 7:44
• @daleif Siep told me some years ago: tug.org/pipermail/tex-live/2014-November/036157.html. But is seems to be new that texlive sets it at installation time ("Was set to 1 if at install time a sufficiently recent Perl was detected."), in texlive 2016 it isn't set. – Ulrike Fischer Jun 21 '17 at 8:40

## 1 Answer

In your error message the @INC path mentions lyx:

@INC contains: C:/Program Files (x86)/LyX 2.2/Perl/lib .


This indicates that latexmk is using an external perl where the needed module is missing.

So your options are:

1. Install the missing modules for this perl.
2. Install another external perl with the needed modules (e.g. active perl or strawberry perl) and ensure that it is found first in the path.
3. Force texlive to ignore the external perl and use its own perl. This you can do by setting TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL = 0 in your local texmf.cnf or by finding the texmf.cnf which sets the variable to one and then changing this value to zero (in my system it is the texmf.cnf in texlive/2017).