in reply to cascade TMPL_LOOP with DBI values

sure, where's the problem?
just fill the following data structure to HTML::Template:
SITES => [ { URL => '...', TAGS => [ { TAG_NAME => 'foo', TAG_WEIGHT => 23 }, { TAG_NAME => 'bar', TAG_WEIGHT => 42 }, ], }, { # second url... }, ]