EnvironmentProblemI've been banging my head on this for a while now, and still cannot figure out what's going on here.
I've got a cgitask script as part of my workflow - the script contains code like this:use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
use TeamSite::CGI_lite;
...
local $| = 1; # autoflush
...
my $cgi = TeamSite::CGI_lite->new();
$cgi->parse_data();
...
if (...){
}
...
else {
# I know I get here from debugging output
pass_one();
}
...
sub pass_one{
my $area = $task->GetArea();
my $files_ref = get_full_file_list($area, $task->GetFiles());
my $tunnel = $cgi->get_implicit_data_tunnel_html();
print "Content-type: text/html\n\n";
print join("\n",
qq(<html>\n<head>\n<title>Preview Content<title>),
qq(</head>\n<body>),
qq(<h1>Preview Content</h1>),
qq(Deploying content to preview servers. Please wait ...<br/>\n));
...
return;
}However, when the script runs, nothing shows up in the window - so I do a View Source and see this:<html>
<head>
<title>Preview Content<title>
</head>
<body>
<h1>Preview Content</h1>
Deploying content to preview servers. Please wait ...<br/>
...Content-type: text/html
...I cannot figure out why the first print statement shows up in the output after the second (and other) print statements.
It's not like one was being sent to STDERR and the other to STDOUT - they're both going to STDOUT.
So - I'm hoping someone here can see what I've managed to miss.
(Note: Even if I put the content-type print statement at the top of the script - it still ends up later in the output)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com