You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by James G Smith <JG...@JameSmith.Com> on 2000/04/02 20:55:37 UTC

Re: Undefined sub problems

Shevek <sh...@tirin.openworld.co.uk> wrote:
>Excuse replying to own post, I screwed up package naming and I have fixed
>it. %INC applies to filenames, the namespaces in packages are independent
>of that.

-nod-

>On Sun, 2 Apr 2000, Shevek wrote:
>> #!/usr/bin/perl
>> BEGIN {
>>         use Apache ();
>>         use lib Apache->server_root_relative('lib/perl');
>> }
>> use Apache::Constants ();
>> use Apache::Registry ();
>> use Apache::Hello ();
>> &Apache::Hello::test;
>> 1;

Btw, you probably don't need the `use lib' statement.  mod_perl
automatically puts $ServerRoot and $ServerRoot/lib/perl in @INC.
(eagle book, pg. 500)

Which raises a question for me -- if $ServerRoot is set in a <Perl>
section, at which point does it affect @INC?  I've been able to include
modules in the httpd.conf file and startup.pl file that were under
one of those two directories without having to `use lib'.
------------------------------------+-----------------------------------------
James Smith - jgsmith@jamesmith.com | http://www.jamesmith.com/
            jsmith@sourcegarden.org | http://sourcegarden.org/
              jgsmith@tamu.edu      | http://cis.tamu.edu/systems/opensystems/
------------------------------------+------------------------------------------