perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilde, Donald" <>
Subject Setting up advanced session handler with memcached
Date Thu, 03 Mar 2005 19:22:24 GMT

After reading of Embperl on, I've decided that it really
is worth examining as a replacement for my php. I've installed mod_perl,
Apache 1.3.33, and MySQL 4 on my FreeBSD 4.11-STABLE system. Looking for
a better way to handle sessions, I found Apache::Session::Memcached. I
don't need it for my current project, but for another I have being done
by other programmers. I can get Apache::Session::File to work properly
in this [* *] format, but memcached does not like being embedded in
embperl, apparently. 

Here's the beginning of my index.epl:

    use Apache;
    use Apache::Session::Memcached;
    my %session;
    tie %session, 'Apache::Session::Memcached', undef, {
        'Servers' => [''],
        'NoRehash' => 1,
        'Readonly' => 0,
        'Debug' => 1,
        'CompressThreshold' => 10_000,

I get:

[728]ERR: 24: Error in Perl code: Can't locate object method "TIEHASH"
+ via package "Apache::Session::Memcached" at /var/web/root/index.epl 
+line 10.

[728]ERR: 24: index.epl(1): Error in Perl code:

Apache/1.3.33 (Unix) mod_perl/1.29 PHP/5.0.0a6-alexdupre HTML::Embperl
+ 1.3.6 [Thu Mar 3 06:49:48 2005]
I've looked through the docs on Apache::Session, Cache::Memcached, and
memcached itself, but it doesn't function. I did try changing the syntax
of the hash from the original example in Apache::Session::Memcached to
the above (from Cache::Memcached), which has quotes around the keys and
has the Servers line as an anon array ref, but neither functions
properly in the embperl context. The above, however, does function in
raw perl; the only thing I changed was adding 
use warnings;
and stripping out the HTML. I get a message on console giving me back a
session ID. I've also tried using the bracket-minus form as opposed to
bracket-asterisk; no diff. 
Given that everything works when executed as a perl script from command
line, the error is almost certainly in my understanding of Embperl.
Thanks in advance! 

Don Wilde 
Org 1737, MS1076, 844-1126

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message