That code does look pretty terrible when it's line wrapped. I'm not using HTML::Template for alot of reasons - mostly because this is running under mason/mod_perl and I'm trying to limit the number of differnt things to maintain. Code/html seperation with Mason is something I've considered.
However your example doesn't simplify the problem. I still have to deal with variable numbers of columns with differing names depending on the value of "$type" and in addition to that the person may or maynot have an image in the directory as well (if 'pic' is defined or not).