That was where I was heading, keeping counts for magazine, issue and article, then resetting the inferior variables when the superior one ticked up.
Still fairly 'orrid though!
Comment on Re: Re: Idiomatic way of getting from database result set to HTML::Template data structure?