Well, I don’t know any perl, but what I needed to do (and did ) was to start with one directory, called LDA, which in turn had 3 nested sets of subdirectories. The first set of children directories have numbers for their names. The most distant children directories each had two text files.
Each of these text files started with the following line as part of them:
[tab][tab]50
where [tab] is the tab character. This line needed to be changed so that the number matched the directory name of the appropriate first child directory of LDA.
After this, I copied LDA to make a new file structure named PBE. I then needed to change one line in all of the text files in PBE (only the most distant child directories contained text files to be edited):
[tab]FUNCTIONAL LDA
to
[tab]FUNCTIONAL PBE
In the future I may be interested in making other such directories besides LDA and PBE, so in the script I used to get the job done, I left in the call to $(basename $(pwd)) instead of just using PBE in the sed script.