in reply to Re^3: multiple-pass search?
in thread multiple-pass search?

I understand; I plead ignorance, and have made note. However, I am searching in a directory in which there are only *-xxx.tex files, with separate directories for articles, abstract, and catalogue.

Replies are listed 'Best First'.
Re^5: multiple-pass search?
by Fletch (Bishop) on Dec 10, 2021 at 13:54 UTC
    However, I am searching in a directory in which there are only . . .

    Famous last words . . . :)

    Which is of course why he's pointing out that you've effectively made that assumption but not implemented it in your code and hence your code is vulnerable to things changing. If you're not going to add anchors you'd probably at the least want to add some sort of comments to this effect about the expectation(s) and mentioning when it can fail. Down the road in n months/years the person fixing the inevitable failure (either future-you or some successor) has something to go on then.

    We'll all cut corners like this at times (see Laziness and Impatience), it just sometimes helps to make it obvious for when they grow pointy again for whatever reason (and your Hubris can gloat that you foresaw this very problem).

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re^5: multiple-pass search?
by jdporter (Paladin) on Dec 10, 2021 at 16:11 UTC

    If that really is a safe assumption, then the code I gave in my solution will work just dandy.

Re^5: multiple-pass search?
by propellerhat (Novice) on Dec 10, 2021 at 18:39 UTC

    I thank you-all for your recommendations. After a single run, most of these Perl routines are destined for the dumpster; they are for my personal use in organizing a small cache of Bible studies. A few lines of Perl script which run in a few seconds, save me hours of typing. The studies, many of which are incomplete, I am editing and publishing, on the web (PDF and EPUB). I am working alone, so whatever does not get published before I die most likely shall never be seen.