---hoge.html---
<TMPL_LOOP NAME='list'>
HOGE:<TMPL_VAR NAME='hoge'>
PIYO:<TMPL_VAR NAME='piyo'>
</TMPL_LOOP>
---------------

#!/usr/bin/env ruby
require 'html/template'
template=HTML::Template.new('filename'=>'hoge.html')
#template.param({'hoge'=>'x'})
#list=[{'piyo'=>'a'},{'piyo'=>'b'},{'piyo'=>'c'}]
list=[{'piyo'=>'a','hoge'=>'x'},{'piyo'=>'b','hoge'=>'x'},{'piyo'=>'c','hoge'=>'x'}]
template.param({'list'=>list})
print(template.output)

↑はコメント外して6行目をコメントにするとエラーになります。
---- error ----
(eval):10:in `<<': failed to convert nil into String (TypeError)
from (eval):10:in `initialize'
from (eval):8:in `each'
from (eval):8:in `initialize'
from (eval):1:in `call'
from ./html/template.rb:67:in `output'
from ./hoge.rb:8
---------------
'hoge'は'piyo'と同じ階層で定義しないといけないのですか?