Re: moose and mod_perl

[email protected] (Stevan Little)
Newsgroups perl.moose
Message-ID <[email protected]>
Mike,

That is very odd, I have had several Moose based apps running under  
mod_perl for a while now without issue.

How exactly are you pre-loading? With a startup.pl?

- Stevan


On Dec 15, 2008, at 11:56 AM, Mike Glen wrote:

> Are there any know issues with using moose and mod_perl when you  
> preload modules in a startup.pl?
>
> I'm running the latest Moose (downloaded today), mod_perl 1, apache  
> 1.3.37 and perl 5.8.8
>
> What seems to be happening is that if i preload any mod_perl scripts  
> using Moose objects then they loose their attributes.
>
> for example I have a Moose class
>
> package MINDsweep::TestClass;
>
> use Moose;
> has 'requiredAttRO' => ( is => 'ro', isa => 'Str', required => 1);
> has 'requiredAttRW' => ( is => 'rw', isa => 'Str', required => 1);
>
> 1;
>
> and a mod_perl script
>
> package MINDsweep::Apache::Test;
>
> use Apache::Request();
> use Apache::Constants qw(OK);
> use MINDsweep::TestClass();
>
> use strict;
>
> sub handler {
>   my $r = Apache::Request->new(shift);
>   my $um;
>     my $test = MINDsweep::TestClass->new( requiredAttRO => 'Read  
> Only', requiredAttRW => 'Read Write' );
>     print '<pre>' . $test->dump() . '</pre>';
>     return OK;
> }
> 1;
>
> with no preloading I get
>
> $VAR1 = bless( {
>                'requiredAttRO' => 'Read Only',
>                'requiredAttRW' => 'Read Write'
>              }, 'MINDsweep::TestClass' );
>
>
>
> but if I preload stuff
>
> $VAR1 = bless( {}, 'MINDsweep::TestClass' );
>
>
>
> Thanks,
> Mike
>
> -- 
> MINDsweep
> 25 albany street
> edinburgh - UK - eh1 3qn
>
> m: 07786984428
>
>
> MINDsweep www.mindsweep.net is a division of c2sky services limited
> www.c2sky.net
>
> This e-mail may contain confidential information.  It is intended  
> solely
> for the attention of the designated recipient(s).  If you are not the
> intended recipient, you must not make any use of the information
> contained in the e-mail or cause or allow anyone to do so.  Please
> contact the sender immediately and delete the message.
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.