Hi,

I'm trying to re-construct a Mason site I had 6 months ago.  I used to
have this working, and I've got all of the HTML and .mas files, but I
can't get the Apache configuration straightened out (and of course
that's the one file I don't have from the old server).

Here's what I have currently:

<VirtualHost 192.168.1.100:80>
  ServerAdmin jcasado...@northbound-train.com
  ServerName foobar.northbound-train.com

  DocumentRoot /foo/bar/html
  AddDefaultCharset UTF-8

  PerlSetVar     MasonDataDir /foo/bar/mason-cache
  PerlSetVar     MasonCompRoot 'util => /foo/bar/mason'
  PerlAddVar     MasonCompRoot 'main => /foo/bar/html'

  SetHandler     perl-script
  PerlHandler    HTML::Mason::ApacheHandler
</VirtualHost>

And what I get is:

error:          Error during compilation of /fo/bar/html/index.html:
Global symbol "$User" requires explicit package name at 
/foo/bar/html/index.html line 43.
Global symbol "$User" requires explicit package name at 
/foo/bar/html/index.html line 44.
Global symbol "$User" requires explicit package name at 
/foo/bar/html/index.html line 44.
Global symbol "$User" requires explicit package name at 
/foo/bar/html/index.html line 45.
Global symbol "$User" requires explicit package name at 
/foo/bar/html/index.html line 45.

context:        
...     
39:     
40:     <!-- <& footer.mas &> -->
41:     
42:     <%init>
43:     my($greeting) = $User->{'charname'};


I have an autohandler in /foo/bar/html with the following code in it
(among other normal autohandler stuff):

<%flags>
inherit => '/syshandler'
</%flags>

and I have code in /foo/bar/html/syshandler that sets up $User in an
<%init%> block.

I get the same error if both handlers are in the /foo/bar/mason
directory.  If I comment out the PerlAddVar directive from the apache
config, then I get this in the apache error log:

[Mason] Cannot resolve file to component: /foo/bar/html/index.html (is file 
outside component root?) at 
/usr/local/share/perl/5.10.0/HTML/Mason/ApacheHandler.pm line 852.

I get this error whether the handlers are in the /foo/bar/mason
directory or the /foo/bar/html directory.  I don't really get this
error, unless it's looking for a component referenced inside of the
index.html file, perhaps?

I know Mason in general works, as I did the 'handshake.html' example
from the Mason book, and I know the directory can server up the HTML
without Mason (if I comment out all of the Mason Apache directives, the
raw HTML file comes up fine.

Does anyone have a clue what I'm doing wrong?  Many thanks!

-- 
Regards,


joe
Joe Casadonte
jcasado...@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
    Ramblings of a Gay Man => http://www.northbound-train.com/ramblings
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to