perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gunnar Wolf <gw...@gwolf.org>
Subject Re: Exit frustration
Date Tue, 12 Dec 2006 16:06:20 GMT
Gerald Richter dijo [Mon, Dec 11, 2006 at 05:25:58AM +0100]:
> Embperl::exit is the right thing to do, but normaly you should not see this
> message, because it's internaly catched by Embperl.
> 
> From where do you call this code in your module?

Ok, seems I'll have to explain my probably twisted logic :)

First of all, the application is an Embperl::Object app, using the
following Apache configuration:

<Location /smb>
    PerlSetVar SMBGATE_INSTANCE smbgate
    PerlSetVar SMBGATE_YAMLCONF /etc/smbgate.yaml

    EMBPERL_OBJECT_APP base.pm
    EMBPERL_APPNAME smbgate
    EMBPERL_OBJECT_FALLBACK index.html
    EMBPERL_ESCMODE 0
    EMBPERL_OPTIONS 16
    EMBPERL_DEBUG 0

    SetHandler perl-script
    PerlHandler Embperl::Object

    Options ExecCGI FollowSymLinks

    RewriteEngine On
    RewriteRule /file/(.*) file?file=$1
    RewriteRule /dir/(.*) ?dir=$1
</Location>

Now, I tried to split the application into logic modules, so from
base.pm I include (use) some modules, among which is
SmbGate::Embperl::WebClient. I am attaching the module as it is now -
of course, it lacks any documentation, but should be just
readable. Now, what triggers this message? For example, when calling
logout.html, which is:

[$ var $dummy $]
[- # Just clear the user session information to leave cleanly, inform
   # the user he has logged out, and redirect to the login screen
   delete $udat{login};
   delete $udat{passwd};
   $epreq->{warnings}->add_msg('Su sesi&oacute;n ha finalizado');
   $epreq->{webclient}->redirect('login.html');
-]

(of course, $epreq->{webclient} is an instantiated
SmbGate::Embperl::WebClient, invoked at base.pm's init)

You will notice I'm using $epreq to hold my various objects so they
are available along the way - I lack a better way of doing this, you
might also point me out to another way of doing this :)

Thanks,

-- 
Gunnar Wolf - gwolf@gwolf.org - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973  F800 D80E F35A 8BB5 27AF

Mime
View raw message