Last modified: 14:52:26, Thu 09 Nov 2000 UTC
As I have emphasized again and again (users: "enough, already!"), epsmerge is intended to run on just about any Perl you might have out there (provided you have 5.000 or later). Many users are at universities or do not otherwise have root access, and can't be bothered with downloading the latest Perl, or even CPAN modules (installing CPAN modules without root access (i.e., in your home directory) while at the same time not aggravating your sysadmin by filling up your disk space?) Version 5.000 is certainly required since epsmerge is object oriented.
Even the Tk interface should run on just about any Tk in existence (at least above 4.0), but since it relies heavily on closures it requires Perl 5.001 or later. (Note: the Tk interface is not finished and I am working on more important aspects of epsmerge at the moment, but I will return to it later.)
epsmerge is able to run perl scripts to generate labels. This is normally useful if (1) you need labels other than a few standard ones such as filename, time or whatever, and (2) you know perl. However, it is also technically a security issue if more than one user uses epsmerge in the same directory (where the default options file will be read).
So far, I have tried to solve the problem by sticking an $Allow_Scripts variable into the epsmerge file (i.e., the one called epsmerge). Default is `false'.
First of all, epsmerge is strict. I.e., if you run it with perl -w then it shouldn't say anything at all. Small Perl programs can easily be written without the strict pragma, but epsmerge is too complex for such youthful foolhardiness.
If you want to get to grips with the internals of epsmerge, you would have a much better chance if you knew about design patterns ([G]). For example:
There could be other patterns that I have forgotten about, but these are the important ones.
I decided to roll my own options handling package to get some more functionality beyond that offered by Getopt::Long. It hasn't quite stabilized in terms of functionality and interface, but there is nothing inside it that says ``epsmerge'', so it could be used for other Perl programs, too. More than half of the file is POD.
As of version 2.0.0, I am trying to build support for extracting pages from (non-encapsulated) postscript files. The difficulty is that they will appear as parts of a page in the generated EPS/PS file, but they might still require prologs and setups. Worse yet, what happens when you merge pages from different postscript files, and they all require different kinds of prologs and setups?
I assume, until proved otherwise, that %%Begin(End)Setup
gives setup code necessary to display page foo, and the
%%Trailer cleans up whichever mess created by the setup.
So each included thingy, whether from a non-encapsulated or encapsulated
postscript file, would get the setup written before the file itself,
and the trailer after it. Likewise, probably the same should happen
with %%Begin(End)PageSetup and %%PageTrailer,
except that page specific DSCs are not handled yet (as of 2.2.0).
Procedures and resources that occur in the included EPS or PS files are, as of 2.2.0, supposed to be written into the target file. However, to ensure that each is not written several times, I test uniqueness by using Perl hashes (rather than just the name specified). The entire body of the procedure/resource is hashed to prevent silly programs from cheating.
Note: the Adobe URLs are no longer valid and I don't know where they have hidden the information. Sorry.
Postscript is a trademark of Adobe Systems, Inc.