Ok, now i really have a brain teaser...

i am making a database. i basically am finished. now im making a program which links directories and categories. In this linker, i have to grab a directory tree and plug it into each config file for each directory. This is accomplished easily, but what is hard is the categories...

you see, there is a category name for each directory, and although i have a way of telling exactly what directory im in, i have no way of telling the full path of categories im in. Basically, i can tell what the current category for the current directory is, but i can't (correctly) get the FULL PATH of categories.

for instance, i know am in directory /webdbase/pc/sw and i know that it is category SoftWare but i dont know how to tell that i am in /Main/PC Stuff/SoftWare. I can record each succeeding category, but that only works if there's 1 directory in each directory (a straight line).

So i thought, maybe i could use a hash, but many of my directory names are the same so it wouldn't work right. so as i parse through different categories and directories, how can i keep them all in line?

To get the directories i made a subroutine that recursively searches for all dirs, then goes back and searches those dirs. it finds all dirs with "db_engine.conf" and puts them all into an array. then i just erase the "db_engine.conf" and i have the full directories.

if you dont get what im saying email me at psypete@phreaker.net and ill give you a copy of the linker so far if you need it.

Edit 2001-04-04 by tye


In reply to My kingdom for a substring by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.