texlive[73044] trunk: perltex (5dec24)

commits+karl at tug.org commits+karl at tug.org
Thu Dec 5 22:22:35 CET 2024


Revision: 73044
          https://tug.org/svn/texlive?view=revision&revision=73044
Author:   karl
Date:     2024-12-05 22:22:35 +0100 (Thu, 05 Dec 2024)
Log Message:
-----------
perltex (5dec24)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/perltex/perltex.pl
    trunk/Master/texmf-dist/doc/latex/perltex/README
    trunk/Master/texmf-dist/doc/latex/perltex/example.tex
    trunk/Master/texmf-dist/doc/latex/perltex/perltex.pdf
    trunk/Master/texmf-dist/doc/man/man1/perltex.1
    trunk/Master/texmf-dist/doc/man/man1/perltex.man1.pdf
    trunk/Master/texmf-dist/scripts/perltex/perltex.pl
    trunk/Master/texmf-dist/source/latex/perltex/perltex.dtx
    trunk/Master/texmf-dist/source/latex/perltex/perltex.ins
    trunk/Master/texmf-dist/tex/latex/perltex/perltex.sty

Modified: trunk/Build/source/texk/texlive/linked_scripts/perltex/perltex.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/perltex/perltex.pl	2024-12-05 21:22:22 UTC (rev 73043)
+++ trunk/Build/source/texk/texlive/linked_scripts/perltex/perltex.pl	2024-12-05 21:22:35 UTC (rev 73044)
@@ -15,7 +15,7 @@
 #
 # This is a generated file.
 #
-# Copyright (C) 2003-2019 Scott Pakin <scott+pt at pakin.org>
+# Copyright (C) 2003-2024 Scott Pakin <scott+pt at pakin.org>
 #
 # This file may be distributed and/or modified under the conditions
 # of the LaTeX Project Public License, either version 1.3c of this

Modified: trunk/Master/texmf-dist/doc/latex/perltex/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/perltex/README	2024-12-05 21:22:22 UTC (rev 73043)
+++ trunk/Master/texmf-dist/doc/latex/perltex/README	2024-12-05 21:22:35 UTC (rev 73044)
@@ -42,7 +42,7 @@
 License
 -------
 
-Copyright (C) 2003-2019 Scott Pakin
+Copyright (C) 2003-2024 Scott Pakin
 
 These files may be distributed and/or modified under the conditions of
 the LaTeX Project Public License, either version 1.3c of this license or

Modified: trunk/Master/texmf-dist/doc/latex/perltex/example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/perltex/example.tex	2024-12-05 21:22:22 UTC (rev 73043)
+++ trunk/Master/texmf-dist/doc/latex/perltex/example.tex	2024-12-05 21:22:35 UTC (rev 73044)
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2003-2019 Scott Pakin <scott+pt at pakin.org>
+%% Copyright (C) 2003-2024 Scott Pakin <scott+pt at pakin.org>
 %% 
 %% This file may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License, either version 1.3c of this license

Modified: trunk/Master/texmf-dist/doc/latex/perltex/perltex.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/perltex.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/perltex.1	2024-12-05 21:22:22 UTC (rev 73043)
+++ trunk/Master/texmf-dist/doc/man/man1/perltex.1	2024-12-05 21:22:35 UTC (rev 73044)
@@ -1,4 +1,5 @@
-.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
+.\" -*- mode: troff; coding: utf-8 -*-
+.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -15,29 +16,12 @@
 .ft R
 .fi
 ..
-.\" Set up some character translations and predefined strings.  \*(-- will
-.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
-.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
-.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
-.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
-.\" nothing in troff, for use with C<>.
-.tr \(*W-
-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
 .ie n \{\
-.    ds -- \(*W-
-.    ds PI pi
-.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
-.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
-.    ds L" ""
-.    ds R" ""
 .    ds C` ""
 .    ds C' ""
 'br\}
 .el\{\
-.    ds -- \|\(em\|
-.    ds PI \(*p
-.    ds L" ``
-.    ds R" ''
 .    ds C`
 .    ds C'
 'br\}
@@ -68,79 +52,17 @@
 .    \}
 .\}
 .rr rF
-.\"
-.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
-.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
-.    \" fudge factors for nroff and troff
-.if n \{\
-.    ds #H 0
-.    ds #V .8m
-.    ds #F .3m
-.    ds #[ \f1
-.    ds #] \fP
-.\}
-.if t \{\
-.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
-.    ds #V .6m
-.    ds #F 0
-.    ds #[ \&
-.    ds #] \&
-.\}
-.    \" simple accents for nroff and troff
-.if n \{\
-.    ds ' \&
-.    ds ` \&
-.    ds ^ \&
-.    ds , \&
-.    ds ~ ~
-.    ds /
-.\}
-.if t \{\
-.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
-.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
-.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
-.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
-.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
-.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
-.\}
-.    \" troff and (daisy-wheel) nroff accents
-.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
-.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
-.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
-.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
-.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
-.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
-.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
-.ds ae a\h'-(\w'a'u*4/10)'e
-.ds Ae A\h'-(\w'A'u*4/10)'E
-.    \" corrections for vroff
-.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
-.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
-.    \" for low resolution devices (crt and lpr)
-.if \n(.H>23 .if \n(.V>19 \
-\{\
-.    ds : e
-.    ds 8 ss
-.    ds o a
-.    ds d- d\h'-1'\(ga
-.    ds D- D\h'-1'\(hy
-.    ds th \o'bp'
-.    ds Th \o'LP'
-.    ds ae ae
-.    ds Ae AE
-.\}
-.rm #[ #] #H #V #F C
 .\" ========================================================================
 .\"
 .IX Title "PERLTEX 1"
-.TH PERLTEX 1 "2019-09-15" "v2.2" " "
+.TH PERLTEX 1 2024-12-03 v2.3 " "
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
 .nh
-.SH "NAME"
+.SH NAME
 perltex \- enable LaTeX macros to be defined in terms of Perl code
-.SH "SYNOPSIS"
+.SH SYNOPSIS
 .IX Header "SYNOPSIS"
 perltex
 [\fB\-\-help\fR]
@@ -149,9 +71,9 @@
 [\fB\-\-permit\fR=\fIfeature\fR]
 [\fB\-\-makesty\fR]
 [\fIlatex options\fR]
-.SH "DESCRIPTION"
+.SH DESCRIPTION
 .IX Header "DESCRIPTION"
-LaTeX \*(-- through the underlying TeX typesetting system \*(-- produces
+LaTeX \-\- through the underlying TeX typesetting system \-\- produces
 beautifully typeset documents but has a macro language that is
 difficult to program.  In particular, support for complex string
 manipulation is largely lacking.  Perl is a popular general-purpose
@@ -168,18 +90,18 @@
 available.  These behave just like LaTeX's \f(CW\*(C`\enewcommand\*(C'\fR and
 \&\f(CW\*(C`\erenewcommand\*(C'\fR except that the macro body contains Perl code instead
 of LaTeX code.
-.SH "OPTIONS"
+.SH OPTIONS
 .IX Header "OPTIONS"
 \&\fBperltex\fR accepts the following command-line options:
-.IP "\fB\-\-help\fR" 4
+.IP \fB\-\-help\fR 4
 .IX Item "--help"
 Display basic usage information.
-.IP "\fB\-\-latex\fR=\fIprogram\fR" 4
+.IP \fB\-\-latex\fR=\fIprogram\fR 4
 .IX Item "--latex=program"
 Specify a program to use instead of \fBlatex\fR.  For example,
 \&\f(CW\*(C`\-\-latex=pdflatex\*(C'\fR would typeset the given document using
 \&\fBpdflatex\fR instead of ordinary \fBlatex\fR.
-.IP "\fB\-\-\fR[\fBno\fR]\fBsafe\fR" 4
+.IP \fB\-\-\fR[\fBno\fR]\fBsafe\fR 4
 .IX Item "--[no]safe"
 Enable or disable sandboxing.  With the default of \fB\-\-safe\fR,
 \&\fBperltex\fR executes the code from a \f(CW\*(C`\eperlnewcommand\*(C'\fR or
@@ -188,13 +110,13 @@
 external programs.  Specifying \fB\-\-nosafe\fR gives the LaTeX document
 \&\fIcarte blanche\fR to execute any arbitrary Perl code, including that
 which can harm the user's files.  See Safe for more information.
-.IP "\fB\-\-permit\fR=\fIfeature\fR" 4
+.IP \fB\-\-permit\fR=\fIfeature\fR 4
 .IX Item "--permit=feature"
 Permit particular Perl operations to be performed.  The \fB\-\-permit\fR
 option, which can be specified more than once on the command line,
 enables finer-grained control over the \fBperltex\fR sandbox.  See
 Opcode for more information.
-.IP "\fB\-\-makesty\fR" 4
+.IP \fB\-\-makesty\fR 4
 .IX Item "--makesty"
 Generate a LaTeX style file called \fInoperltex.sty\fR.  Replacing the
 document's \f(CW\*(C`\eusepackage{perltex}\*(C'\fR line with \f(CW\*(C`\eusepackage{noperltex}\*(C'\fR
@@ -209,7 +131,7 @@
 passed to \fBlatex\fR (or whatever program was specified with
 \&\f(CW\*(C`\-\-latex\*(C'\fR), including, for instance, the name of the \fI.tex\fR file to
 compile.
-.SH "EXAMPLES"
+.SH EXAMPLES
 .IX Header "EXAMPLES"
 In its simplest form, \fBperltex\fR is run just like \fBlatex\fR:
 .PP
@@ -241,49 +163,49 @@
 \&    perltex \-\-permit=:browse \-\-permit=:filesys_open
 \&      \-\-permit=time myfile.tex
 .Ve
-.SH "ENVIRONMENT"
+.SH ENVIRONMENT
 .IX Header "ENVIRONMENT"
 \&\fBperltex\fR honors the following environment variables:
-.IP "\s-1PERLTEX\s0" 4
+.IP PERLTEX 4
 .IX Item "PERLTEX"
 Specify the filename of the LaTeX compiler.  The LaTeX compiler
 defaults to ``\f(CW\*(C`latex\*(C'\fR''.  The \f(CW\*(C`PERLTEX\*(C'\fR environment variable
 overrides this default, and the \fB\-\-latex\fR command-line option (see
-\&\*(L"\s-1OPTIONS\*(R"\s0) overrides that.
-.SH "FILES"
+"OPTIONS") overrides that.
+.SH FILES
 .IX Header "FILES"
 While compiling \fIjobname.tex\fR, \fBperltex\fR makes use of the following
 files:
-.IP "\fIjobname.lgpl\fR" 4
+.IP \fIjobname.lgpl\fR 4
 .IX Item "jobname.lgpl"
 log file written by Perl; helpful for debugging Perl macros
-.IP "\fIjobname.topl\fR" 4
+.IP \fIjobname.topl\fR 4
 .IX Item "jobname.topl"
 information sent from LaTeX to Perl
-.IP "\fIjobname.frpl\fR" 4
+.IP \fIjobname.frpl\fR 4
 .IX Item "jobname.frpl"
 information sent from Perl to LaTeX
-.IP "\fIjobname.tfpl\fR" 4
+.IP \fIjobname.tfpl\fR 4
 .IX Item "jobname.tfpl"
 ``flag'' file whose existence indicates that \fIjobname.topl\fR contains
 valid data
-.IP "\fIjobname.ffpl\fR" 4
+.IP \fIjobname.ffpl\fR 4
 .IX Item "jobname.ffpl"
 ``flag'' file whose existence indicates that \fIjobname.frpl\fR contains
 valid data
-.IP "\fIjobname.dfpl\fR" 4
+.IP \fIjobname.dfpl\fR 4
 .IX Item "jobname.dfpl"
 ``flag'' file whose existence indicates that \fIjobname.ffpl\fR has been
 deleted
-.IP "\fInoperltex\-#.tex\fR" 4
+.IP \fInoperltex\-#.tex\fR 4
 .IX Item "noperltex-#.tex"
 file generated by \fInoperltex.sty\fR for each PerlTeX macro invocation
-.SH "NOTES"
+.SH NOTES
 .IX Header "NOTES"
 \&\fBperltex\fR's sandbox defaults to what Opcode calls ``\f(CW\*(C`:browse\*(C'\fR''.
 .SH "SEE ALSO"
 .IX Header "SEE ALSO"
 \&\fBlatex\fR\|(1), \fBpdflatex\fR\|(1), \fBperl\fR\|(1), \fBSafe\fR\|(3pm), \fBOpcode\fR\|(3pm)
-.SH "AUTHOR"
+.SH AUTHOR
 .IX Header "AUTHOR"
 Scott Pakin, \fIscott+pt at pakin.org\fR

Modified: trunk/Master/texmf-dist/doc/man/man1/perltex.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/scripts/perltex/perltex.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/perltex/perltex.pl	2024-12-05 21:22:22 UTC (rev 73043)
+++ trunk/Master/texmf-dist/scripts/perltex/perltex.pl	2024-12-05 21:22:35 UTC (rev 73044)
@@ -15,7 +15,7 @@
 #
 # This is a generated file.
 #
-# Copyright (C) 2003-2019 Scott Pakin <scott+pt at pakin.org>
+# Copyright (C) 2003-2024 Scott Pakin <scott+pt at pakin.org>
 #
 # This file may be distributed and/or modified under the conditions
 # of the LaTeX Project Public License, either version 1.3c of this

Modified: trunk/Master/texmf-dist/source/latex/perltex/perltex.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/perltex/perltex.dtx	2024-12-05 21:22:22 UTC (rev 73043)
+++ trunk/Master/texmf-dist/source/latex/perltex/perltex.dtx	2024-12-05 21:22:35 UTC (rev 73044)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2003-2019 Scott Pakin <scott+pt at pakin.org>
+% Copyright (C) 2003-2024 Scott Pakin <scott+pt at pakin.org>
 % --------------------------------------------------------
 %
 % This file may be distributed and/or modified under the conditions of
@@ -22,7 +22,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{perltex}
 %<*package>
-    [2019/09/14 v2.2 LaTeX macros for use with PerlTeX]
+    [2024/12/03 v2.3 LaTeX macros for use with PerlTeX]
 %</package>
 %
 %<*driver>
@@ -60,7 +60,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{605}
+% \CheckSum{622}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -919,7 +919,7 @@
 %   \section{License agreement}
 %   \label{sec:license}
 %
-%   Copyright \textcopyright{} 2003--2019 Scott Pakin \texttt{<scott+pt at pakin.org>}
+%   Copyright \textcopyright{} 2003--2024 Scott Pakin \texttt{<scott+pt at pakin.org>}
 %
 %   \providecommand{\url}[1]{\texttt{##1}}
 %
@@ -1887,6 +1887,47 @@
 % |\plmac at fromflag| exists.  Deferring the read to the end, however,
 % enables \PerlTeX{} to support recursive macro invocations.
 %
+% \begin{macro}{\plmac at infile}
+% \begin{macro}{\plmac at IfFileExists}
+% \changes{v2.3}{2024/12/03}{Introduce this macro, which implements a
+%   non-caching version of \string\cs{IfFileExists}}
+% The Await operations in Figure~\ref{fig:comm-protocol} require testing
+% if a file exists.  On the \LaTeX\ side, this normally would be
+% achieved using \LaTeX's \cs{IfFileExists} macro, and this is indeed
+% what \PerlTeX\ did until version~2.2.  However, the \mbox{1-Jun-2023}
+% release of \LaTeX3 introduced a performance optimization that lets
+% \cs{IfFileExists} cache prior results.  (See
+% \url{https://www.latex-project.org/news/latex2e-news/ltnews37.pdf}.)
+% In other words, once \cs{IfFileExists} determines that a file exists,
+% it will follow the \textsc{true} branch on all subsequent calls
+% without ever re-checking if the file still exists.  This semantics
+% breaks the protocol described in Figure~\ref{fig:comm-protocol} by
+% enabling Await to return before the file being waited for actually
+% exists.
+%
+% To work around \LaTeX3's new behavior, we define our own version of
+% \cs{IfFileExists} called \cs{plmac at IfFileExists}, which is derived
+% from \cs{IfFileExists}'s simpler, more straightforward
+% \LaTeXe\ implementation.  In particular, file existence is checked
+% explicitly on each invocation.
+%    \begin{macrocode}
+\newread\plmac at infile
+%    \end{macrocode}
+%    \begin{macrocode}
+\newcommand{\plmac at IfFileExists}[3]{%
+  \openin\plmac at infile=#1 %
+  \ifeof\plmac at infile
+    \def\plmac at next{#3}%
+  \else
+    \closein\plmac at infile
+    \def\plmac at next{#2}%
+  \fi
+  \plmac at next
+}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % \begin{macro}{\plmac at await@existence}
 % \changes{v1.9}{2009/09/13}{Put the
 %   \texttt{\string\string\string\input\string\string\string\plmac at pipe}
@@ -1895,11 +1936,10 @@
 % \begin{macro}{\ifplmac at file@exists}
 % \begin{macro}{\plmac at file@existstrue}
 % \begin{macro}{\plmac at file@existsfalse}
-% The purpose of the |\plmac at await@existence| macro is to repeatedly
+% The purpose of the \cs{plmac at await@existence} macro is repeatedly to
 % check the existence of a given file until the file actually exists.
-% For convenience, we use \LaTeXe's |\IfFileExists| macro to check the
-% file and invoke |\plmac at file@existstrue| or |\plmac at file@existsfalse|,
-% as appropriate.
+% We use \cs{plmac at IfFileExists} (defined above) to check if the file
+% exists and accordingly either continue or exit the loop.
 %
 % As a performance optimization we |\input| a named pipe.  This causes
 % the |latex| process to relinquish the CPU until the |perltex| process
@@ -1921,9 +1961,9 @@
     \input\plmac at pipe
   \end{lrbox}%
   \loop
-    \IfFileExists{#1}%
-                 {\plmac at file@existstrue}%
-                 {\plmac at file@existsfalse}%
+    \plmac at IfFileExists{#1}%
+                       {\plmac at file@existstrue}%
+                       {\plmac at file@existsfalse}%
     \ifplmac at file@exists
     \else
   \repeat
@@ -2151,7 +2191,7 @@
 #
 # This is a generated file.
 #
-# Copyright (C) 2003-2019 Scott Pakin <scott+pt at pakin.org>
+# Copyright (C) 2003-2024 Scott Pakin <scott+pt at pakin.org>
 #
 # This file may be distributed and/or modified under the conditions
 # of the LaTeX Project Public License, either version 1.3c of this

Modified: trunk/Master/texmf-dist/source/latex/perltex/perltex.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/perltex/perltex.ins	2024-12-05 21:22:22 UTC (rev 73043)
+++ trunk/Master/texmf-dist/source/latex/perltex/perltex.ins	2024-12-05 21:22:35 UTC (rev 73044)
@@ -1,5 +1,5 @@
 %%
-%% Copyright (C) 2003--2019 Scott Pakin <scott+pt at pakin.org>
+%% Copyright (C) 2003-2024 Scott Pakin <scott+pt at pakin.org>
 %%
 %% This file may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License, either version 1.3c of this license
@@ -21,7 +21,7 @@
 
 This is a generated file.
 
-Copyright (C) 2003-2019 Scott Pakin <scott+pt at pakin.org>
+Copyright (C) 2003-2024 Scott Pakin <scott+pt at pakin.org>
 
 This file may be distributed and/or modified under the conditions of
 the LaTeX Project Public License, either version 1.3c of this license

Modified: trunk/Master/texmf-dist/tex/latex/perltex/perltex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/perltex/perltex.sty	2024-12-05 21:22:22 UTC (rev 73043)
+++ trunk/Master/texmf-dist/tex/latex/perltex/perltex.sty	2024-12-05 21:22:35 UTC (rev 73044)
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2003-2019 Scott Pakin <scott+pt at pakin.org>
+%% Copyright (C) 2003-2024 Scott Pakin <scott+pt at pakin.org>
 %% 
 %% This file may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License, either version 1.3c of this license
@@ -22,7 +22,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{perltex}
-    [2019/09/14 v2.2 LaTeX macros for use with PerlTeX]
+    [2024/12/03 v2.3 LaTeX macros for use with PerlTeX]
 \newif\ifplmac at required
 \plmac at requiredtrue
 \DeclareOption{optional}{\plmac at requiredfalse}
@@ -206,6 +206,17 @@
   }%
   \plmac at run@code
 }
+\newread\plmac at infile
+\newcommand{\plmac at IfFileExists}[3]{%
+  \openin\plmac at infile=#1 %
+  \ifeof\plmac at infile
+    \def\plmac at next{#3}%
+  \else
+    \closein\plmac at infile
+    \def\plmac at next{#2}%
+  \fi
+  \plmac at next
+}
 \newif\ifplmac at file@exists
 \newcommand{\plmac at await@existence}[1]{%
   \begin{lrbox}{\@tempboxa}%
@@ -212,9 +223,9 @@
     \input\plmac at pipe
   \end{lrbox}%
   \loop
-    \IfFileExists{#1}%
-                 {\plmac at file@existstrue}%
-                 {\plmac at file@existsfalse}%
+    \plmac at IfFileExists{#1}%
+                       {\plmac at file@existstrue}%
+                       {\plmac at file@existsfalse}%
     \ifplmac at file@exists
     \else
   \repeat



More information about the tex-live-commits mailing list.