Hello
I have a rather complex mod_perl CGI which calls pages from
a database which are intereted with EMBPERL.
I seem to randomly loose my objects from the EMBPERL pages.
For example we have one page from the database called with the following code:
1 [- use FINANCEMOD;
2 $obj = FINANCEMOD->new(\%fdat) -]
3
4 [$ if $fdat{finance_page} eq "result" $]
5 [- $obj->init_results();
6 $obj->create_statement();
7 $html_txt = $obj->get_html_txt();
8 %fdat = %{$obj->{'_fdatref'}}; -]
9 [$ endif $] [# finance_page = result #]
10
11 [# print the top of the page #]
12 [- $head = $obj->page_head(); -]
13 [- $escmode = 0 -]
14 [+ $head +]
15 [- $escmode = 3 -]
16
17 [$ if $fdat{finance_page} eq "result" $]
18 [# pass all needed fdat and object values to local variables for use below #]
19 [$ if ($html_txt->[0]) $] [# If there are results, print the table. #]
I get the following error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and inform them
of the time the error occurred, and
anything you might have done that may have caused the error.
[19086]ERR: 24: Line 12: Error in Perl code: Uncaught exception from user code:
Can't call method "page_head" without a package or object reference at somegirls
line 12.
HTML::Embperl::DOC::_1::__ANON__ called at
/usr/lib/perl5/site_perl/HTML/Embperl.pm line 551
eval {...} called at /usr/lib/perl5/site_perl/HTML/Embperl.pm line 551
HTML::Embperl::CleanCallExecuteReq('HTML::Embperl::Req=SCALAR(0x8344120)',
'ARRAY(0x8438674)') called at
/usr/lib/perl5/site_perl/HTML/Embperl.pm line 723
HTML::Embperl::Execute('HASH(0x84385a8)') called at
/var/lib/httpd/cgi-bin/patients.cgi line 812
Apache::ROOT::cgi_2dbin::patients_2ecgi::parseperl('[- use FINANCEMOD; ^J $obj =
FINANCEMOD->new(%fdat)
-]^J^J[$ if $f...') called at /var/lib/httpd/cgi-bin/patients.cgi line 274
Apache::ROOT::cgi_2dbin::patients_2ecgi::openfinance called at
/var/lib/httpd/cgi-bin/patients.cgi line 127
Apache::ROOT::cgi_2dbin::patients_2ecgi::check called at
/var/lib/httpd/cgi-bin/patients.cgi line 66
Apache::ROOT::cgi_2dbin::patients_2ecgi::handler('Apache=SCALAR(0x83f3be0)')
called
[19086]ERR: 32: Line 14: Warning in Perl code: Use of uninitialized value at somegirls
in block starting at line 14.
Apache/1.3.4 (Unix) mod_perl/1.18 HTML::Embperl 1.2b4 [Mon Jan 3 22:25:39 2000]
--------------
If we don't include the semicolon after the use statement, the module
fails to be called into the program at all.
What is the best way to make sure use works in a page?
I'm very confused about how the scoping works. It looks like a bug in
EMBPERL. The documentation on the scoping is also confusing
What exactly is the difference between [- -] and [* *]?
Ruben