ok, now i have a question that im sure someone could answer... it's about returning a list of strings from a string. i am making a web database, and i have it going actually pretty well so far, but ive gotten snagged a bit. in my monk-like quest to make my site look a little like yah00 in the way it shows oyu what category you're in, the database gets 2 strings from a local config file: the directory hirearchy you're in (your full directory path, minus all that /home/user/web/ stuff) and the category name hirearchy (for each directory, there's a category name, and it is put liek a directory listing). ok, this isnt confusing cuz the entry looks like this:
CurrCat: /Main/PC Stuff -_-_/webdbase/PC
the "/Main/PC Stuff" is the categories for "/webdbase/PC". so, the directory for category "Main" is "webdbase" and the directory for category "PC Stuff" is "PC". now, i have to return that so it looks like this on the web page: "::/Main::/PC" with a link to "Main" and a link to "PC". This is sorta working with about 3 lines of code (3 for the directory array and 3 for the category array) but the arrays are different... where the category array just has a different category for each entry in the array, the directory entries have to contain the FULL PATH (relative to the web server) for each link. so, the array would look a bit like this for the categories: ("Main", "PC") and like this for the directories: ("/webdbase", "/webdbase/PC").
Now that i have thoroughly confused you, here is the code that i have used to try and do this. it does not work, cuz the FULL directory path is not put in properly (from my testing).
while ($CURRDIR =~ m/\//) {
unshift (@dacurdirs, substr($CURRDIR, rindex($CURRDIR, "/")));
$CURRDIR = substr($CURRDIR, 0, index($CURRDIR, "/"));
}
while ($CURRCAT =~ m/\//) {
unshift (@dacurcats, substr($CURRCAT, rindex($CURRCAT, "/")));
$CURRCAT = substr($CURRCAT, index($CURRCAT, "/"), rindex($CURRCAT, "/"
+));
}
if anyone could just fix that thing directory part so it puts the ful path id be grateful.