perlquestion
Anonymous Monk
I am a total newbie to perl, teaching myself so please bear that in mind!<br><br>
I have a database (pipe delimited flat file) that I am accessing through CGI using a query_string eg. getoffers.cgi?Category&subcategory (eg. getoffers.cgi?Household&Alarms - this will give a list of all the alarm companies within the Household category)<br><br>
The fields are in this order:<br>category|subcategory|company|etc|etc<br><br>
I have this part working fine and displaying the offers from their respective category and sub-category within the database file.<br><br>
The problem I have is that I want to be able to display the list of sub-categories and the number of offers within each in a given category by calling getoffers.cgi?Category (this would, in the case of Household list all the sub-categories like so: Alarms (3) Antiques (2) Sub-category and the number of entries with that sub-category in brackets)<br><br>
I am really stuck on this, I guess I have to make an array of all the sub-categories and then count the amount of same named entries, then display only one of each.<br><br>
I hope I explained this in a way that at least one of you can understand!<br><br>
Thanks in advance for any help.<br>
1