Home > Archive > PERL CGI Beginners > February 2005 > How to use sub directories in IIS and Apache HTTPD
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to use sub directories in IIS and Apache HTTPD
|
|
| Siegfried Heintze 2005-02-06, 3:55 am |
| When I try to employ subdirectories my perl cgi programs stop working. This
is because the "use" statements cannot find their files.
I could convert the "use evidence_db;" statements to "require
'../evidence_db.pm';" and that works. But this is painful.
Surely there is an easier way. I thought of going into the IIS setup and put
a "-I" switch for the perl statement IIS uses to invoke perl for CGI.
However, that could mess up other applications in other sites if I am not
the only site on the machine.
I don't know where I would change the setting in apache HTTPD for just the
current site either.
Can someone tell me?
Thanks,
Siegfried
| |
| Wiggins d'Anconia 2005-02-07, 3:55 pm |
| Siegfried Heintze wrote:
> When I try to employ subdirectories my perl cgi programs stop working. This
> is because the "use" statements cannot find their files.
>
> I could convert the "use evidence_db;" statements to "require
> '../evidence_db.pm';" and that works. But this is painful.
>
> Surely there is an easier way. I thought of going into the IIS setup and put
> a "-I" switch for the perl statement IIS uses to invoke perl for CGI.
> However, that could mess up other applications in other sites if I am not
> the only site on the machine.
>
> I don't know where I would change the setting in apache HTTPD for just the
> current site either.
>
> Can someone tell me?
>
> Thanks,
> Siegfried
>
>
perldoc lib
You can add directories to the @INC array at compile time. You may also
be interested in
perldoc FindBin
For instance in the top of my CGI handler I have,
use FindBin;
use lib "$FindBin::Bin/../../lib";
use lib "$FindBin::Bin/../lib";
http://danconia.org
|
|
|
|
|