Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Collapsing smaller scripts into a larger one, request for comment

by jcb (Parson)
on May 29, 2020 at 23:42 UTC ( [id://11117485]=note: print w/replies, xml ) Need Help??


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

How is that a problem? You seem to still be storing one file per page, just with a .txt suffix instead of a .pl suffix, unless I misunderstand. Another option is to ensure that the list of valid collections is stored in some recognizable way at each index, and have the menu builder parse the indexes.

  • Comment on Re: Collapsing smaller scripts into a larger one, request for comment

Replies are listed 'Best First'.
Re^2: Collapsing smaller scripts into a larger one, request for comment
by Lady_Aleena (Priest) on May 30, 2020 at 01:14 UTC

    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

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11117485]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-24 06:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found