I have a modperl site that accesses a number of modules.
In my startup.pl I have:
#!/usr/bin/perl -w
use strict;
use lib('/path/to/my/installation'); # 'site' directory is here
use Apache::DBI;
use Apache::StatINC;
use site::customers;
use site::orders;
use site::products;
use site::base;
1;
None of the modules exports *any* symbols at all - all are called in
the form:
$product=site::products->new(23);
$product->get('price');
First question:
If site::products calls functions from site::customers, do I need
a 'use site::customers' in site::products, when I have already
done a 'use' in my startup.pl?
Second question:
site::products contains the line:
@ISA=('site::base');
so that methods from site::base can be overridden in site::products.
Do I need a 'use site::base' in site::products for this to work
correctly?
Third (unrelated) question.
Is $ENV{foo}='bar'; in startup.pl equivalent to PerlSetEnv foo bar
in httpd.conf?
-----------------------
Experience has shown that I *don't* need the 'use' statements anywhere
other than startup.pl - but I am not sure why, and would find some pointers
to a discussion of this very useful. I would also be interested to know that
if the 'use' statements *are* unnecessary, does including them add any extra
overhead of processing/memory??
Many thanks,
Chris Allen.