use CGI::Application::Plugin::Output::XSV qw(:all); # headers generated will be [ "first", "last", "phone" ] return $self->xsv_report_web({ values => [ { first_name => 'Jack', last_name => 'Tors', phone => '555-1212' }, { first_name => 'Frank', last_name => 'Rizzo', phone => '555-1515' }, ], fields => [ qw(first_name last_name phone) ], headers_cb => sub { my @h = @{ +shift }; s/_name$// foreach @h; return \@h; }, });