Hi All,
Thanks very much to all who responded to my first post, very informative and I got it to work! I have one more question. When searching initially, I searched based on elements in a 1D array. I now want to search based on something modeled after a 2D array. So the structure would hold the name and type of an object, search for a match of the name in that file, and return the name and type of any name found in the file.
So, if the structure contained the following values:
structure = { name1, type1;
name2, type2;
name3, type3;
name4, type4
};
The search would match name1 to the data contained in the file, and if found, store the name1 and type1 into another structure. It would do this for each name in the structure and store both the name and type for any name string found in the file.
What is the best way to do this? I would like to stay away from a 2D array if possible, and am wondering if there is some kind of array of structures I use.
Again, any help or advice is welcomed. Thanks!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.