Fellow Monks of great Perlness:

After the recent discussion on templating, I've decided this old code-dawg needs new tricks. So, I've installed Embperl and decided that Apache::Session::Memcached would make me never want to PHP again. My first impression is that mod_perl+Embperl is really superior to PHP, with a lot of helpful extensions that will make web-wonking a treat. This particular app doesn't need the speed of memcached, but I have other apps that will, so I'd like to get it running.

So, for your perusal, here's the beginning of index.epl, and the error that it produces:
[* use Apache; use Apache::Session::Memcached; my %session; tie %session, 'Apache::Session::Memcached', undef, { 'Servers' => ['127.0.0.1:20000'], 'NoRehash' => 1, 'Readonly' => 0, 'Debug' => 1, 'CompressThreshold' => 10_000, }; *] <HTML> <HEAD> ...
[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, which has quotes around the keys and has the Servers line be an anon array ref, but neither functions properly in the embperl context. The above, however, does function in raw perl; ther only thing I changed was adding
#!/usr/bin/perl 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.

Thanks in advance!

In reply to embperl and Apache::Session::Memcached by samizdat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.