You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Torsten Luettgert <t....@pressestimmen.de> on 2003/07/21 17:12:17 UTC
Strange problem with Embperl 2.0b9 + httpd 2.0.40
Hi,
today I tried to migrate from Embperl 1.3.6 with apache 1.3.27
to apache 2.0.40-21.3 (from RedHat 9) plus mod_perl 1.99_09 and
Embperl 2.0b9.
First, everything seems to work well. I made a test page:
<html><body><h2>test page</h2>
[-
++$udat{'blah'};
$a = localtime();
print OUT "The time is $a, and you're asking for this the ".
"$udat{'blah'}th time<br>\n";
print OUT "Oh, and your udat is:<br>\n";
require CGI;
foreach (keys %udat) {
print OUT CGI::escapeHTML($_)." -> ".
CGI::escapeHTML($udat{$_})."<br>\n";
}
-]
<form method="post">
<input type="submit" name="action" value="Again">
</form>
</body></html>
It works on the first time, and also if I hit reload (the number
stored in %udat increases).
BUT if I hit the "Again" button, I get a 500, with the message
[Mon Jul 21 16:40:29 2003] [error] [9479]ERR: 24: Error in Perl code:
Can't locate object method "READ" via package "Apache::RequestRec" at
(eval 38) line 6, <GEN0> line 2.! * /var/www/html/index.ep
And now for the strange part. If take out the two CGI::escapeHTML's
(must be both of them, one's not enough) and just write
print OUT $_." -> ".$udat{$_}."<br>\n";
it works! With reload and the button and everything!
What am I missing here?
- Torsten Lüttgert <t....@pressestimmen.de>
RedHat linux 9, with (self-built) kernel 2.4.21
httpd-2.0.40-21.3
perl 5.8.0-88, with perl threads disabled
mod_perl 1.99_09
Embperl 2.0b9
Apache::SessionX 2.00b5 sitting on top of
Apache::Session 1.54, with sessions stored
in files, with semaphore locking
/etc/httpd/conf.d/embperl.conf:
LoadModule perl_module modules/mod_perl.so
LoadModule embperl_module
/usr/lib/perl5/site_perl/5.8.0/i386-linux/auto/Embperl/Embperl.so
PerlModule Embperl
AddType text/html .ep
<Files *.ep>
SetHandler perl-script
PerlHandler Embperl
Options ExecCGI
</Files>
Embperl_Log /tmp/embperl.log
Embperl_Debug 0
Embperl_Output_Mode 0
Embperl_Useenv off
Embperl_Escmode 0
Embperl_Input_Escmode 0
# 1=cookie, 2=als Parameter im hidden-Feld
Embperl_Session_Mode 1
# 16384: redirect stdout (to OUT)
# 262144: errors an Apache zurueckgeben
# 134217728: optShowBacktrace
#
Embperl_Options 134496256
# damit der Cookie (und damit %udat) site-wide gilt
Embperl_Cookie_Path /
DirectoryIndex index.ep index.html index.php
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Strange problem with Embperl 2.0b9 + httpd 2.0.40
Posted by Gerald Richter <ri...@ecos.de>.
Am Montag, 4. August 2003 13:10 schrieb Torsten Luettgert:
> On Son, 2003-08-03 at 20:06, Gerald Richter via COM.BOX TEMA wrote:
> > > For your escaping use the $req->Escape from Embperl (I don't know if it
> > > is available in Embperl2 - Gerald?).
> >
> > Yes, it's available in Embperl 2, but you don't need this escaping at
> > all, unless you turned it off, Embperl will escape any output from [+ +]
> > or print OUT anyway.
>
> I did turn it off, since I need to write out tags from perl code
> (without, using embperl would be kind of pointless for me).
>
> Never mind anyway, I had a look at CGI.pm's escapeHTML routine and
> took out the interesting parts in a small sub.
>
As Luiz wrote in his mail (07/21/03) the Escape method of the Embperl request
object is able to do html and url escaping without the need of an extra
module for you
Gerald
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Strange problem with Embperl 2.0b9 + httpd 2.0.40
Posted by Gerald Richter <ri...@ecos.de>.
>
> You should not use CGI inside Embperl because it will try to read the
> form fields again and conflict with Embperl, and make your app BIG.
>
Yes, that the problem here
> For your escaping use the $req->Escape from Embperl (I don't know if it
> is available in Embperl2 - Gerald?).
>
Yes, it's available in Embperl 2, but you don't need this escaping at all,
unless you turned it off, Embperl will escape any output from [+ +] or print
OUT anyway.
Gerald
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Strange problem with Embperl 2.0b9 + httpd 2.0.40
Posted by Luiz Fernando <lu...@engenhosolucoes.com.br>.
Hi,
You should not use CGI inside Embperl because it will try to read the
form fields again and conflict with Embperl, and make your app BIG.
For your escaping use the $req->Escape from Embperl (I don't know if it
is available in Embperl2 - Gerald?).
Regards,
--
Luiz Fernando Ribeiro
Engenho Soluções S/C Ltda
On Mon, 2003-07-21 at 12:12, Torsten Luettgert wrote:
> Hi,
>
> today I tried to migrate from Embperl 1.3.6 with apache 1.3.27
> to apache 2.0.40-21.3 (from RedHat 9) plus mod_perl 1.99_09 and
> Embperl 2.0b9.
> First, everything seems to work well. I made a test page:
>
> <html><body><h2>test page</h2>
> [-
> ++$udat{'blah'};
> $a = localtime();
> print OUT "The time is $a, and you're asking for this the ".
> "$udat{'blah'}th time<br>\n";
>
> print OUT "Oh, and your udat is:<br>\n";
> require CGI;
> foreach (keys %udat) {
> print OUT CGI::escapeHTML($_)." -> ".
> CGI::escapeHTML($udat{$_})."<br>\n";
> }
> -]
> <form method="post">
> <input type="submit" name="action" value="Again">
> </form>
> </body></html>
>
> It works on the first time, and also if I hit reload (the number
> stored in %udat increases).
>
> BUT if I hit the "Again" button, I get a 500, with the message
>
> [Mon Jul 21 16:40:29 2003] [error] [9479]ERR: 24: Error in Perl code:
> Can't locate object method "READ" via package "Apache::RequestRec" at
> (eval 38) line 6, <GEN0> line 2.! * /var/www/html/index.ep
>
> And now for the strange part. If take out the two CGI::escapeHTML's
> (must be both of them, one's not enough) and just write
>
> print OUT $_." -> ".$udat{$_}."<br>\n";
>
> it works! With reload and the button and everything!
> What am I missing here?
>
> - Torsten LÃŒttgert <t....@pressestimmen.de>
>
>
> RedHat linux 9, with (self-built) kernel 2.4.21
> httpd-2.0.40-21.3
> perl 5.8.0-88, with perl threads disabled
> mod_perl 1.99_09
> Embperl 2.0b9
> Apache::SessionX 2.00b5 sitting on top of
> Apache::Session 1.54, with sessions stored
> in files, with semaphore locking
>
> /etc/httpd/conf.d/embperl.conf:
> LoadModule perl_module modules/mod_perl.so
>
> LoadModule embperl_module
> /usr/lib/perl5/site_perl/5.8.0/i386-linux/auto/Embperl/Embperl.so
> PerlModule Embperl
> AddType text/html .ep
>
> <Files *.ep>
> SetHandler perl-script
> PerlHandler Embperl
> Options ExecCGI
> </Files>
>
> Embperl_Log /tmp/embperl.log
> Embperl_Debug 0
> Embperl_Output_Mode 0
> Embperl_Useenv off
> Embperl_Escmode 0
> Embperl_Input_Escmode 0
>
> # 1=cookie, 2=als Parameter im hidden-Feld
> Embperl_Session_Mode 1
>
> # 16384: redirect stdout (to OUT)
> # 262144: errors an Apache zurueckgeben
> # 134217728: optShowBacktrace
> #
> Embperl_Options 134496256
>
> # damit der Cookie (und damit %udat) site-wide gilt
> Embperl_Cookie_Path /
>
> DirectoryIndex index.ep index.html index.php
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org