Thanks everyone, I know where I'm going now! -
I was groping towards
davido's approach - starting with deepest hash first - but hit my learning ceiling (I hail from land of JavaScript) so thanks for the lesson, Dave.
Sorry I didn't give more background info:
the csv file (maybe 300 or so lines/records) is posted by the client, who gets to decide himself:
- how many levels of folder depth he wants on his website this month
- how many fields display for each record
So the
first line of the parsed csv file gives me the FolderTitles list, annotated to tell the script how 'deep' the html site is going to be
The first few fields on each subsequent line tell me the path where that record will live, and the leftover fields make up the record itself.
Each line is always the same length.
I previously hacked up an undignified version of the site using arrays and it's been working fine (and fast) but hashes would be simpler
Anyway, thanks again,
rjc
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.