in reply to Directory Structure parsing
On the other hand, depending on how your categories and subcategories are, another approach might be better. If you can clarify your question, I can probably give you a better answer.while(readdir(DIRHANDLE)) { if(s/^clocks//) { $thisline{category} = 'clocks'; } if(s/^birds//) { $thisline{category} = 'birds'; } ... if(! defined($thisline{category})) { die "No category defined!\n"; } if(s/^vert//) { $thisline{category} = 'vert'; } ... # And so on, for 2nd level subcategories. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Directory Structure parsing
by bscheiman (Initiate) on Apr 01, 2003 at 23:16 UTC |