I
it_says_BALLS_on_your forehead
I recently installed mod_perl 2.0, apache 2.2, and Perl 5.8.7 on my dev
box.
I would like to take the most advantage of mod_perl's module caching as
i can.
(I hope this is the proper forum).
# in the httpd.conf, i have this:
LoadModule perl_module modules/mod_perl.so
PerlRequire "/path/to/startup.pl"
<Location /cgi-bin/ >
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Location>
# in startup.pl, i have this:
use lib "/path/to/webObjects";
use Apache2 ( );
use ModPerl::Registry ( );
use Carp;
use CGI;
use lib_webObjects;
1;
# in lib_webObjects.pm, i have:
use strict;
use HTML::Entities;
use CGI qw
all);
use DBI;
# Base
use lib_config;
use lib_standard;
use parse_template;
use lib_random;
# Web Page Library
use lib_page;
use lib_sheet;
# Web Objects
use lib_container;
use lib_button;
1;
# ...now in the browser, i call a script: librarySamples.pl, which has
the following:
#!/apps/webstats/perl/bin/perl
use strict;
use CGI qw
all);
use URI::Escape;
use HTML::Entities;
use Date::Manip;
use lib_webObjects;
# Render page
print &get_page_header_html();
# ...the above function is defined in lib_page.pm, which is use'd in
lib_webObjects.
this is the function:
sub get_page_header_html {
return "Content-type: text/html\n";
}
# i can run librarySamples.pl successfully from the command line, but
when
# i run it through the browser, i get this in the error log
[Tue Jan 24 15:21:34 2006] [notice] Apache/2.2.0 (Unix) mod_perl/2.0.2
Perl/v5.8.7 configured -- resuming normal operations
[Tue Jan 24 15:21:38 2006] [error] Undefined subroutine
&ModPerl::ROOT::ModPerl::Registry::apps_webstats_apache2_cgi_2dbin_webObjects_librarySamples_2epl::get_page_header_html
called at /apps/webstats/apache2/cgi-bin/webObjects/librarySamples.pl
line 55.\n
I am new to mod_perl. i am trying to cache all of my custom perl
modules. if i use() them in startup.pl, do i have to use() them in each
script as well? after conducting some research online, i have the
suspicion that this may be a namespace issue, but i'm at a loss as to
how to proceed from here. how do i get my script to recognize the
function that is being use'd? help would be much appreciated.
box.
I would like to take the most advantage of mod_perl's module caching as
i can.
(I hope this is the proper forum).
# in the httpd.conf, i have this:
LoadModule perl_module modules/mod_perl.so
PerlRequire "/path/to/startup.pl"
<Location /cgi-bin/ >
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Location>
# in startup.pl, i have this:
use lib "/path/to/webObjects";
use Apache2 ( );
use ModPerl::Registry ( );
use Carp;
use CGI;
use lib_webObjects;
1;
# in lib_webObjects.pm, i have:
use strict;
use HTML::Entities;
use CGI qw
use DBI;
# Base
use lib_config;
use lib_standard;
use parse_template;
use lib_random;
# Web Page Library
use lib_page;
use lib_sheet;
# Web Objects
use lib_container;
use lib_button;
1;
# ...now in the browser, i call a script: librarySamples.pl, which has
the following:
#!/apps/webstats/perl/bin/perl
use strict;
use CGI qw
use URI::Escape;
use HTML::Entities;
use Date::Manip;
use lib_webObjects;
# Render page
print &get_page_header_html();
# ...the above function is defined in lib_page.pm, which is use'd in
lib_webObjects.
this is the function:
sub get_page_header_html {
return "Content-type: text/html\n";
}
# i can run librarySamples.pl successfully from the command line, but
when
# i run it through the browser, i get this in the error log
[Tue Jan 24 15:21:34 2006] [notice] Apache/2.2.0 (Unix) mod_perl/2.0.2
Perl/v5.8.7 configured -- resuming normal operations
[Tue Jan 24 15:21:38 2006] [error] Undefined subroutine
&ModPerl::ROOT::ModPerl::Registry::apps_webstats_apache2_cgi_2dbin_webObjects_librarySamples_2epl::get_page_header_html
called at /apps/webstats/apache2/cgi-bin/webObjects/librarySamples.pl
line 55.\n
I am new to mod_perl. i am trying to cache all of my custom perl
modules. if i use() them in startup.pl, do i have to use() them in each
script as well? after conducting some research online, i have the
suspicion that this may be a namespace issue, but i'm at a loss as to
how to proceed from here. how do i get my script to recognize the
function that is being use'd? help would be much appreciated.