Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Trying to display subcategories and counts

by plaid (Chaplain)
on May 04, 2000 at 23:22 UTC ( #10259=note: print w/replies, xml ) Need Help??

in reply to Trying to display subcategories and counts

What you'll need to do is, as described above, create some type of data structure out of the file beforehand. What you might want to do is start with a chunk of code like
my($category, $subcategory) = split(/&/, $ENV{'QUERY_STRING'}); if($subcategory ne "") { # Read in the file and look for the subcategory # specified, as you are already doing } else { # Read in the file and count the values in the # subcategory, as per turnstep's answer above. }
This would get you the desired behavior of having a CGI that can handle with and without a subcategory.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://10259]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2022-05-24 18:57 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (84 votes). Check out past polls.