Thank you BrowserUk for your suggestion to describe the use-case/the project needs in more detail.

What I want is a tree structure like a directory tree. I'd like to read the text files together with directory-specific configuration files into memory and collect all words marked to be used as search tags (and their aliases). In a second pass all documents are searched again and the tag index is completed. In the third and last pass the web site consisting of the files in the directory tree is built (merging the HTML design templates with the content text files producing html pages, and some generated pages like sitemaps, indexes, galleries and the like).

This is the reason why I'd like to have structs where I can cleanly collect page data, image data, tags and so on.

I could of course use the deprecated BASIC style without any technical problems. But I'd prefer not to use a global array for each and every struct member. Through appropriate naming the code would at least be relatively easy to understand and to modify. But dealing with lots of lists (arrays) of indices to global arrays would be cumbersome. Maybe there indeed exists a "Perl-ish" way to avoid this... but I am still a fresh novice and still need to learn the perlish way of thinking...


In reply to Re^6: How to allocate a struct? by dissident
in thread How to allocate a struct? by dissident

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.