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
"<form method=\"get\" action=\"".$excel_url."\">\n"
.&get_form_field_submit("Download Report to Excel")."\n"
."</form>\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 "</body>\n";
print "</html>\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.
