[Israel.pm] help with "use base"

Scott Weisman sweisman at pobox.com
Sun Aug 8 13:49:01 PDT 2004


I've got an app I've been writing on my box that has been working just fine.

It has a module that looks exactly like this:

package cmf::control::web::front;
use base 'cmf::control::web';
use strict;


That's it. It's a placeholder file with no code.

My box has Arch Linux on it, with Perl 5.8.5, and my own Apache 2.0.50 
and mod_perl 1.99_14 installed.

When I do an HTTP request, I create an object $obj of class 
cmf::control::web::front, in the package cmf::control::web, then do 
$obj->session_check(). session_check() is a sub defined in 
cmf::control::web, and it executes just fine. It looks something like 
this (heavily condensed, but gets the point accross):

package cmf::control::web;
use strict;

sub handler
     my $r = shift;
     my $obj = bless {}, 'cmf::control::web::front';
     return Apache::OK;

self session_check
     my $self = shift;
     # session check code goes here


Today, after much development, I started installing my code on a 
production box, which has Red Hat Enterprise Linux ES release 2.1 
(Panama) on it. I did my own install of Perl, Apache, and mod_perl to be 
identical to that on my own machine.

However, no matter what I try, I get the following error:

[Sun Aug 08 13:22:52 2004] [error] [client] Can't locate 
object method "session_check" via package "cmf::control::web::front" at 
/opt/cmf/lib/cmf/control/web.pm line 57.

Why am I getting this error? Is there something about the Red Hat 
install that causes this problem, even though I am using my own install 
of Apache and Perl?

I preload all modules in my startup.pl, and as I said above, everything 
has worked fine for months on my own box.

Any help you can provide would be appreciated.



More information about the Perl mailing list