The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Port' 'Port Description' 'Node Count' ]) %]

[% FOREACH row IN results %]
  [% mylist = [] %]
  [% mylist.push(row.dns || row.name || row.ip) %]
  [% mylist.push(row.port) %]
  [% mylist.push(row.description) %]
  [% mylist.push(row.mac_count) %]
  [% CSV.dump(mylist) %]

[% END %]