[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] RFC: Sub applications, CGI and mod_perl issues


On Tue, Aug 23, 2005 at 12:06:31PM -0700, Tony Fraser wrote:
> On Mon, 2005-08-22 at 17:12, Roberto Ruiz wrote:
> > }
> > 
> > # ee/ has app modules, lib/ has cpan local installed modules
> > use lib qw( /home/rruiz/perl/ee /home/rruiz/perl/lib );
> > use strict;
> > use DoubleApp;
> 
> [ snip ]
> -------------------- Apache 2 error log:
> > [Mon Aug 22 17:28:28 2005] [error] Error executing run mode 'mode2': 
> > Can't locate DoubleSubApp.pm in @INC (@INC contains: 
> > /usr/lib/perl5/Apache2 /etc/perl /usr/local/lib/perl/5.8.4 
> > /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 
> > /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl 
> > /etc/apache2) at /home/rruiz/perl/ee/DoubleApp.pm line 25.\n at 
> > /home/rruiz/pcgi-bin/double-mod
> > line 16\n
> 
> Where's the /home/rruiz/perl/ee and /home/rruiz/perl/lib?
> 
> You should set @INC in your httpd.conf or I think you can set it in your
> startup.pl (not sure if it will work in startup.pl). I think the most
> common approach is to use the PerlSwitches directive in httpd.conf:
> 
> PerlSwitches -I/home/rruiz/perl/ee -I/home/rruiz/perl/lib

Thank you Tony,

This did it. I know it had more to do with mod_perl than C::A. This
should be a common problem amongst us starting with it, but didn't find
anything on this (googled for it, but don't found anything).

The strange thing is that with the use lib's the runmodes in the main
application module work between calls, but the runmodes in the sub
applications don't. I mean, on first load, mode1 is executed, works;
click on mode3, it works; click in mode1, works; click in mode2 and it
fails and with the error show uphere and in the original post.

I think is strange because both, DoubleApp.pm and DoubleSubApp.pm, are
in the /home/rruiz/perl/ee/ directory. But the app only fails when
DoubleApp.pm is require'd instead of use'd. Is this normal?

TIA, God bless.
Roberto Ruiz


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.