FAQ
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($_)." -&gt; ".
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 $_." -&gt; ".$udat{$_}."<br>\n";

it works! With reload and the button and everything!
What am I missing here?

- Torsten Lüttgert <t.luettgert@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

Search Discussions

  • Luiz Fernando at Jul 21, 2003 at 3:33 pm
    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($_)." -&gt; ".
    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 $_." -&gt; ".$udat{$_}."<br>\n";

    it works! With reload and the button and everything!
    What am I missing here?

    - Torsten Lüttgert <t.luettgert@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
  • Gerald Richter at Aug 3, 2003 at 6:05 pm

    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
  • Gerald Richter at Aug 10, 2003 at 6:23 pm

    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
  • Knut Behrends at Jul 21, 2003 at 3:51 pm
    What about the URI::Escape module?
    Should it be used at all, maybe for non-OO use of 1.3 ? Should be
    mentioned in the documentation, how to escape /unescape form data. I for
    one missed a brief explanation of this.

    Knut Behrends



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org
  • Luiz Fernando at Jul 21, 2003 at 4:25 pm
    Hi,

    I found a message from Gerald that explains this:

    Embperl 1.3.4 and 2.0b8 has an undocumented (should be in the docs in
    the
    next release) method to do escaping:

    [-
    $r = shift ;

    # second parameter: 1 html escape, 2 url escape (same as $escmode)
    $escaped = $r -> Escape ($ENV{REQUEST_URI}, 2) ;
    -]

    Gerald

    --
    Luiz Fernando Ribeiro
    Engenho Soluções S/C Ltda
    On Mon, 2003-07-21 at 12:51, Knut Behrends wrote:
    What about the URI::Escape module?
    Should it be used at all, maybe for non-OO use of 1.3 ? Should be
    mentioned in the documentation, how to escape /unescape form data. I for
    one missed a brief explanation of this.

    Knut Behrends



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupembperl @
categoriesmodperl, perl
postedJul 21, '03 at 3:12p
activeAug 10, '03 at 6:23p
posts6
users4
websiteperl.apache.org

People

Translate

site design / logo © 2022 Grokbase