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

Thank you. I've removed the print headers, and altered my print statement to return rather than print the data, but i'm just getting the first return value. Any ides?
  • Comment on Re^2: CGI to CGI::Application, headers problem

Replies are listed 'Best First'.
Re^3: CGI to CGI::Application, headers problem
by Anonymous Monk on Jan 20, 2011 at 11:23 UTC
    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; ...