The memory leaks in HTML::Mason (1.35) have finally annoyed my ISP to the
point that I had to promise them I would upgrade to Mason2.  That said, I'm
really having a hard time juggling all the moving parts that seem to be
documented as having been changed in the new version.

I looked through most of the archive and couldn't find what I needed.

I'm hoping that in getting my own questions answered we can all then have a
suitable migration document.  I will outline the individual pieces that
construct my Mason 1.35 website and then ask what about each piece needs to
change.

/* httpd.conf */
PerlModule /path/to/HTML::Mason::ApacheHandler
PerlSetVar MasonDataDir /var/www/mason
PerlSetVar MasonCompRoot /var/www/html
<LocationMatch "/.*\.html$">
    SetHandler perl-script
    PerlHandler HTML::Mason::ApacheHandler
</LocationMatch>

Is there a one-to-one translation in httpd.conf for the above directives?


In the autohandler, I use HTML::Mason to create sessions as follows.
/* autohandler */
<%init>
{ package HTML::Mason::Commands;
   use vars qw(%session);
   use CGI::Cookie;
   use Apache::DBI;
   use Apache::Session::DBI;
   use Apache::Session::MySQL;
}

# Get the incoming cookies
my %cookies = parse CGI::Cookie($r->headers_in->{Cookie});

# Try to re-establish an existing session
eval {
    tie %HTML::Mason::Commands::session, 'Apache::Session::MySQL',
    ($cookies{$cookie_name} ? $cookies{$cookie_name}->value() : undef),
    {
         Handle => $dbh,
         LockHandle => $dbh
    }
    ;
};
...
</%init>

Is the <%init> block still used the same way?  Could I just change
HTML::Mason to Mason2.12 and everything work wrt sessions?

/* general component calls */
$m -> call_next(dbh => $dbh)
I saw a note to use Moose inner, but without elaboration.  How do I
translate this?

$m -> comp('/path/to/component.mas:methodname');
Does this change at all in Mason 2?

<& /path/to/component.mas, dbh=>$dbh &>
Does this change at all in Mason 2?

Just to confirm, $ARGS{name} is now $.args->{name} ?


"<%args> and <%shared> are gone. Use Moose attributes instead."  What does
this mean practically?  What would
<%args>
 $dbh
</%args>
look like in Moose?

Thanks for everything. I have loved using Mason to build my site which is
for a animal rescue organization.  The dogs and I thank you!

Eddie Rowe
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to