Perl extensions

TopLeaf provides an interface that allows you to pass data between the typesetting process and an embedded Perl interpreter. Perl extensions can be used if you need to apply more complex transformations or calculations.

TopLeaf invokes a single Perl interpreter for each typesetting run, which means that any global Perl variables set in one mapping can be accessed from subsequent mappings. Note that the Perl environment is completely separate from the typesetting environment, and so setting a variable within Perl (for example, $Width = 1;) has no effect whatsoever on the value of theTopLeaf user variable {Width} (or vice-versa).

The commands described below can be used to pass information back and forth between Perl and TopLeaf.

[Warning] Warning

Those unfamiliar with the Perl language can find documentation at www.perl.com; those who do not require Perl extensions can ignore this section.