http://qs321.pair.com?node_id=11117488


in reply to Re: Collapsing smaller scripts into a larger one, request for comment
in thread Collapsing smaller scripts into a larger one, request for comment

Here is the difference:

./Collections # is where scripts live and is where base_men +u looks for menu items ./files/data/Collections # is where data lives and is not where base_m +enu looks for menu items

Taking the data outside of individual scripts means I need to figure out how I am going to rewrite base_menu to find items to add to my site menu that will work for all the index files (see below).

./Collections/index.pl ./Fandom/index.pl ./Fandom/Crossovers/index.pl ./Fandom/Crossovers/Big_fake_companies/index.pl ./Fandom/Crossovers/Westphall_crossovers/index.pl ./Fandom/Fictional_family_trees/index.pl ./Fandom/The_Riftwar/index.pl ./Fandom/Xanth/index.pl ./Miscellany/index.pl ./Miscellany/Geeky_thoughts/index.pl ./Miscellany/Political_opinions/index.pl ./Movies/index.pl ./Role_playing/index.pl ./Role_playing/Locations/Afma/index.pl ./Role_playing/Locations/index.pl ./Role_playing/Magic_items/index.pl ./Role_playing/Miscellany/index.pl ./Role_playing/Monsters/index.pl ./Role_playing/Player_characters/index.pl ./Role_playing/Reference_tables/index.pl ./Writing/index.pl ./Writing/Erotic_fiction/index.pl ./Writing/Fan_fiction/index.pl ./Writing/Poetry/index.pl

The data for those indexes will be in the following.

./files/data/Collections/ ./files/data/Fandom/ ./files/data/Fandom/Crossovers/ ./files/data/Fandom/Crossovers/Big_fake_companies/ ./files/data/Fandom/Crossovers/Westphall_crossovers/ ./files/data/Fandom/Fictional_family_trees/ ./files/data/Fandom/The_Riftwar/ ./files/data/Fandom/Xanth/ ./files/data/Miscellany/ ./files/data/Miscellany/Geeky_thoughts/ ./files/data/Miscellany/Political_opinions/ ./files/data/Movies/ ./files/data/Role_playing/ ./files/data/Role_playing/Locations/ ./files/data/Role_playing/Locations/Afma/ ./files/data/Role_playing/Magic_items/ ./files/data/Role_playing/Miscellany/ ./files/data/Role_playing/Monsters/ ./files/data/Role_playing/Player_characters/ ./files/data/Role_playing/Reference_tables/ ./files/data/Writing/ ./files/data/Writing/Erotic_fiction/ ./files/data/Writing/Fan_fiction/ ./files/data/Writing/Poetry/

This is what I am grappling with in my head.

My OS is Debian 10 (Buster); my perl versions are 5.28.1 local and 5.8.8 on web host.

Version control is a non-issue, I do not use it.

No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena

Replies are listed 'Best First'.
Re^3: Collapsing smaller scripts into a larger one, request for comment
by jcb (Parson) on May 31, 2020 at 00:48 UTC

    For each index.pl in the equivalent of find . -name index.pl, try ($dir = $indexfile) =~ s!^[.]/!./files/data/! and glob $dir.'*.txt' (obviously untested) as a starting point, if the files in those directories correspond to menu items.