hesco has asked for the wisdom of the Perl Monks concerning the following question:

This one is new to me, any ideas what it means and how to track down a fix? I'm getting at stderr, the following:

hesco@marcus2:~/sandbox/DistroPrsRls$ perl -wc lib/DistroPrsRls.pm Base class package "DistroPrsRlsAuth" is empty. (Perhaps you need to 'use' the module which defines that package f +irst.) at lib/DistroPrsRls.pm line 5 BEGIN failed--compilation aborted at lib/DistroPrsRls.pm line 5.
The DistroPrsRlsAuth.pm file includes, in toto:
package DistroPrsRlsAuth; use base 'CGI::Application'; sub cgiapp_prerun { my $self = shift; # add run-level specific authorization checks here return; } 1;
And the first few lines of DistroPrsRls.pm read:
package DistroPrsRls; use Carp; # use base 'CGI::Application'; use base 'DistroPrsRlsAuth'; sub setup {
This is my first spin with CGI::Application. All help is appreciated. Thanks.

-- Hugh

Replies are listed 'Best First'.
Re: Decoding Error Messages
by kwaping (Priest) on Feb 10, 2006 at 23:14 UTC
    Is DistroPrsRlsAuth.pm in your @INC properly?
Re: Decoding Error Messages
by samtregar (Abbot) on Feb 10, 2006 at 23:37 UTC
    You need to tell Perl where to find your libraries. You can do this a number of ways. For example, you could set PERL5LIB before running your module:

      $ export PERL5LIB=~/sandbox/DistroPrsRls/lib

    Or you could do it in the code:

      use lib '/home/hesco/sandbox/DistroPrsRls/lib';

    You can find out where Perl is looking for modules using this line of code (in a BEGIN so it runs before your error occurs):

       BEGIN { print join(', ', @INC), "\n" }

    -sam

    PS: Choose a better name for your module! The programmers who come after you will thank you for a name they can pronounce.

Re: Decoding Error Messages
by hesco (Deacon) on Feb 11, 2006 at 00:16 UTC
    OK. I added the lib statement to the module file as well. Now I'm getting these errors thrown by the CGI::Application::run() method:

    No such run mode 'start' at /var/wwwssl/auth-test/dprnew.cgi line 6 (in cleanup) Can't access `DESTROY' field in object of class D +istroPrsRls. at /var/wwwssl/auth-test/dprnew.cgi line 0
    My DistroPrsRls::setup() method reads:

    sub setup { my $self = shift; $self->start_mode('mode1'); $self->mode_param('rm'); $self->run_modes( 'mode1' => 'Login', 'mode2' => 'DPR_Dashboard', 'mode3' => 'EnterPrsRls', 'mode4' => 'ApprovePrsRls', 'mode5' => 'ChooseLists', 'mode6' => 'ScheduleDistro', 'mode7' => 'AuthorizeDistro', 'mode8' => 'ReviewJobs' ); return 1; }
    Do I need to name one of the keys or values from the run_modes hash, 'start' to make this module work for me?

    Thanks for your help.

    -- Hugh

Re: Decoding Error Messages
by mda2 (Hermit) on Feb 10, 2006 at 23:58 UTC
    You need first "use" DistroPrsRlsAuth package into your code.

    ... defines that package first ...

    --
    Marco Antonio
    Rio-PM

      No. use base 'module' executes require module. If base is unable to load the module form a /Can't locate/ error, it displays the message the OP posted.