Odd script behavior.

Odd script behavior.

am 29.11.2005 16:26:43 von cogross

I have some perl code, running through CGI that is behaving oddly, and
I can't seem to figure out what is going wrong.

At the end of a Report Module, I have this:

#logging code added
my $dir =
$cf{'reportsdatadirectory'}."/$cf{'journalabbrev'}_".time(). "_extraction_rpt.log";
open(LOG, ">$dir");
print LOG time()."-----opened log!\n\n";

##### Display excel download button and print button if
appropriate
if ($printer) {
print &get_print_start();
} else {
&send_start();

print LOG time()."-----calling
&get_print_report_button()\n";
print &get_print_report_button();
print LOG time()."-----done
&get_print_report_button()\n\n";

print LOG time()."-----calling &write_excel_from_html()\n";
print LOG time()."excel_file=[$excel_file]\n";
print LOG time()."rpt_html=\n$rpt_html\n";
# Generate excel file and display button to download it
&write_excel_from_html(\$rpt_html, $excel_file);
print LOG time()."-----done &write_excel_from_html()\n\n";

print LOG time()."-----preparing to make excel button\n";
print
"

\n"
.&get_form_field_submit("Download Report to Excel")."\n"
."
\n";
print LOG time()."-----get_form_field_submit
results:[".&get_form_field_submit("Download Report to Excel")."]\n";
print LOG time()."-----excel button made\n\n";
}
print LOG time()."-----dump report html\n";
##### Dump report
print $rpt_html;
print LOG time()."-----report html dumped\n\n";

}
print LOG time()."-----printing ending\n";
# End report
if ($printer) {
print "\n";
print "\n";
} else {
&send_end();
}
print LOG time()."-----end printed\n\n";
# Free mem
undef $rpt_html;
undef %ms;
undef %p;
print LOG time()."-----end of report\n";
close LOG;
return;

The logfile that is created has everything that is printed to it, but
the only thing that is displayed in the browser is the print button
(from the &get_print_report_button() function, which I'm not currently
posting).
The $rpt_html has valid html (created an html file from the data in the
logfile).
The report runs fine for all data sets except one, but I can't seem to
find any bad data in it.

Any comments, suggestions, ideas? I've been dubmstruck with this for a
few days, and I figure a fresh thought might help out.
I can provide more information, if need be.

Re: Odd script behavior.

am 29.11.2005 21:45:50 von Joe Smith

cogross@gmail.com wrote:

> The logfile that is created has everything that is printed to it, but
> the only thing that is displayed in the browser is the print button

Use the browser's View Source feature to verify that what the
browser received is what you thought you sent.

Re: Odd script behavior.

am 29.11.2005 23:05:46 von cogross

Did that, it didn't have anything beyond:
print &get_print_report_button();

There was some bad data in the result set (was large, took time to go
through), but I figured out the problem.

Thanks though.