in reply to Re^2: CGI to CGI::Application, headers problem
in thread CGI to CGI::Application, headers problem

Well, you don't simply swap return for print, because as you've discovered, return exits a subroutine (see perlintro)

The CGI::Application documentation shows you the correct way to do it

... my $output = ""; foreach my $row ( @$Results ) { $output .= "$row->{'DOC_SUB_TYPE'}|$row->{'DESCRIPTION'}\n"; } return $output; ...