Hi all

I'm getting a "CODE(0x7fe2bc5dfba8) not memoized at
/usr/share/perl/5.10/Memoize.pm line 204." when using Mason2 with
PerlDancer, but only when  running under Apache.


How to reproduce (install  Dancer & Dancer::Template::Mason2 first):


Make a simple dancer app:

$ dancer Simple

Start it:

$ Simple/bin/app.pl

And view http://localhost:3000

And you will see a default page. Good.

Copy views/index.tt to views/index.mc
Copy views/layout/main.tt to views/layout/main.mc

and convert them to Mason2 or just simple HTML pages

index,mc:
<p>Running with Mason</p>

main.mc:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-type" content="text/html; charset=<%
$.settings->{charset} %>" />
<title>Simple</title>
<link rel="stylesheet" href="<% $.request->{uri_base} %>/css/style.css" />

</head>
<body>
 <% $.content %>
</body>
</html>

<%args>
$.content
$.request
$.settings
</%args>

And in config.yml

replace:
  template: "simple"
with
  template: "mason2"

Restart dancer:

bin/app.pl

and all is good.

Now do it under Apache:

Create a httpd.conf:

    PerlModule Dancer::Template::Mason2;

    <VirtualHost *:80>

        ServerName www.simple.new
        ServerAlias simple.new
        DocumentRoot /home/yours/DancerTest/Simple

        <Directory  /home/yours/DancerTest/Simple>
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>

        <Location />
            SetHandler perl-script
            PerlHandler Plack::Handler::Apache2
            PerlSetVar psgi_app /home/yours/DancerTest/Simple/bin/app.pl
        </Location>

        ErrorLog  /var/log/apache2/simple_error_log
        CustomLog /var/log/apache2/simple_access_log common
    </VirtualHost>

(This is taken from Dancers Deployment guide)

Start apache & go to http://www.simple.new and you will get the runtime
error.

I've got latest versions of Dancer, Mason2 & Dancer::Template::Mason2;

ta for any insights


Stephen
------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to