FAQ
Hi,

I'm currently reworking a mid-sized web application to run on Embperl 2.
Removing all calls to CGI.pm was a bit of a pain, but at least
everything runs a bit faster now.

Now I'm running into another problem: is it true I cannot use exit() in
a module? I get this error if I try:

[Mon Jan 12 17:56:44 2004] [error] [6785]ERR: 24: Error in Perl code:
Undefined subroutine &ModPerl::Util::exit called at
/home/tema/tema/TEMA.pm line 458.

Any help to offer?

- Torsten

Search Discussions

  • Torsten Luettgert at Jan 13, 2004 at 10:26 am
    Hi,

    I'm currently reworking a mid-sized web application to run on Embperl 2.
    Removing all calls to CGI.pm was a bit of a pain, but at least
    everything runs a bit faster now.

    Now I'm running into another problem: is it true I cannot use exit() in
    a module? I get this error if I try:

    [Mon Jan 12 17:56:44 2004] [error] [6785]ERR: 24: Error in Perl code:
    Undefined subroutine &ModPerl::Util::exit called at
    /home/tema/tema/TEMA.pm line 458.

    Any help to offer?

    - Torsten

    P.S.: Sorry if this message appears twice... sent it with the wrong sender
    address on 1st try.



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org
  • Gerald Richter at Jan 13, 2004 at 7:40 pm

    [Mon Jan 12 17:56:44 2004] [error] [6785]ERR: 24: Error in Perl
    code: Undefined subroutine &ModPerl::Util::exit called at
    /home/tema/tema/TEMA.pm line 458.
    Do you use mod_perl? If yes, which version 1.x or 2.x?

    Gerald

    --------------------------------------------------------------
    Gerald Richter ecos electronic communication services gmbh
    IT-Securitylösungen * dynamische Webapplikationen * Consulting

    Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
    E-Mail: richter@ecos.de Voice: +49 6133 939-122
    WWW: http://www.ecos.de/ Fax: +49 6133 939-333
    --------------------------------------------------------------
    ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
    +-------------------------------------------------------------


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org
  • Torsten Luettgert at Jan 14, 2004 at 1:57 pm

    On Die, 2004-01-13 at 20:40, Gerald Richter wrote:

    [Mon Jan 12 17:56:44 2004] [error] [6785]ERR: 24: Error in Perl
    code: Undefined subroutine &ModPerl::Util::exit called at
    /home/tema/tema/TEMA.pm line 458.
    Do you use mod_perl? If yes, which version 1.x or 2.x?
    Yes, I use mod_perl version 1.99_09 from Fedora Core 1
    (mod_perl-1.99_09-10). It runs on httpd-2.0.47-10 from the
    same distribution.

    The rest of the system is essentially RedHat 9. My perl is
    5.8.0-88.3 which I recompiled not to use perl threads.

    Oh, and I'm using Embperl 2.0b9.

    - Torsten



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org
  • Gerald Richter at Jan 14, 2004 at 3:04 pm

    Torsten Luettgert wrote:
    On Die, 2004-01-13 at 20:40, Gerald Richter wrote:

    [Mon Jan 12 17:56:44 2004] [error] [6785]ERR: 24: Error in Perl
    code: Undefined subroutine &ModPerl::Util::exit called at
    /home/tema/tema/TEMA.pm line 458.
    Do you use mod_perl? If yes, which version 1.x or 2.x?
    Yes, I use mod_perl version 1.99_09 from Fedora Core 1
    (mod_perl-1.99_09-10). It runs on httpd-2.0.47-10 from the
    same distribution.
    So try to put a

    use ModPerl::Util ;

    in your module, that should fix the problem

    Gerald

    The rest of the system is essentially RedHat 9. My perl is
    5.8.0-88.3 which I recompiled not to use perl threads.

    Oh, and I'm using Embperl 2.0b9.

    - Torsten



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org
    --------------------------------------------------------------
    Gerald Richter ecos electronic communication services gmbh
    IT-Securitylösungen * dynamische Webapplikationen * Consulting

    Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
    E-Mail: richter@ecos.de Voice: +49 6133 939-122
    WWW: http://www.ecos.de/ Fax: +49 6133 939-333
    --------------------------------------------------------------
    ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
    +-------------------------------------------------------------


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org
  • Torsten Luettgert at Jan 14, 2004 at 4:01 pm

    On Mit, 2004-01-14 at 16:03, Gerald Richter wrote:
    [Mon Jan 12 17:56:44 2004] [error] [6785]ERR: 24: Error in Perl
    code: Undefined subroutine &ModPerl::Util::exit called at
    /home/tema/tema/TEMA.pm line 458.
    So try to put a

    use ModPerl::Util ;

    in your module, that should fix the problem
    In a way, it does... the error disappears.
    It works, too, IF the method containing exit() is called from
    the "top level page", meaning, not from a page called by Execute()
    from another page.

    So, if I do something like

    index.ep:
    Execute("/var/www/some/path/page2.ep");

    page2.ep:
    Blah1
    [-
    require Module;
    Module::test_exit();
    -]
    Blah2

    Module.pm:
    (header stuff skipped)
    use ModPerl::Util;
    sub test_exit() { exit(); }
    1;

    the stuff after test_exit() is still processed. And what's more,
    I saw [+ ... +] passages as literal text on the page.

    Anyway, if that's too esoteric, I can work around the problem
    (using return codes and exit()ing from the page itself, mostly).
    But it sure makes the code ugly.

    - Torsten



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org
  • Gerald Richter at Jan 15, 2004 at 9:42 am

    It works, too, IF the method containing exit() is called from
    the "top level page", meaning, not from a page called by Execute()
    from another page.
    Yes, that is like exit always work in Embperl. It only exits the current
    component, since 2.0b8 you can also exit the whole request, by giving exit
    an argument, like

    exit (1) ;

    If this still doesn't work, let me know and I will try to fix it


    Gerald



    --------------------------------------------------------------
    Gerald Richter ecos electronic communication services gmbh
    IT-Securitylösungen * dynamische Webapplikationen * Consulting

    Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
    E-Mail: richter@ecos.de Voice: +49 6133 939-122
    WWW: http://www.ecos.de/ Fax: +49 6133 939-333
    --------------------------------------------------------------
    ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
    +-------------------------------------------------------------


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org
  • Torsten Luettgert at Jan 15, 2004 at 11:37 am

    On Don, 2004-01-15 at 10:42, Gerald Richter wrote:
    It works, too, IF the method containing exit() is called from
    the "top level page", meaning, not from a page called by Execute()
    from another page.
    Yes, that is like exit always work in Embperl. It only exits the current
    component, since 2.0b8 you can also exit the whole request, by giving exit
    an argument, like
    Yes, I knew (and like!) this. But if I use a design like stated in the
    last mail, the current page (the one calling exit() via a .pm sub)
    continues to run.

    I'll check what happens if I use exit(1). The behaviour I hoped for
    was that calling SomeModule::function_that_calls_exit() will behave
    the same as calling exit() directly.

    - Torsten


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org
  • Gerald Richter at Jan 15, 2004 at 12:10 pm

    The behaviour I hoped for
    was that calling SomeModule::function_that_calls_exit() will behave
    the same as calling exit() directly.
    Yes, that should be the case. If not that's a bug in Embperl.

    Gerald

    --------------------------------------------------------------
    Gerald Richter ecos electronic communication services gmbh
    IT-Securitylösungen * dynamische Webapplikationen * Consulting

    Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
    E-Mail: richter@ecos.de Voice: +49 6133 939-122
    WWW: http://www.ecos.de/ Fax: +49 6133 939-333
    --------------------------------------------------------------
    ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
    +-------------------------------------------------------------


    ---------------------------------------------------------------------
    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
postedJan 13, '04 at 10:13a
activeJan 15, '04 at 12:10p
posts9
users3
websiteperl.apache.org

People

Translate

site design / logo © 2022 Grokbase