There are lots of ways to do anything in any language. Of course there is a way to do things in perl.
Perhaps you need help with the basic logic flow? Break it up into simple steps:
- Step through the file one line at a time and apply regexes
- If you see a category change, remember that.
- If you see a resource is available, increment the tally for the current category. (Use a Hash, since categories are arbitrary strings, rather than sequential numbers)
- When done, print the totals.