allyc has asked for the wisdom of the Perl Monks concerning the following question:
Monks,
Could any one give me some pointers on the following problem. We currently have a small suite of Perl Web Applications that we use. Because there are many actions that are common to all of the applications, we have created a common file called common.pl. This file contains functions that the other applications can call.
At the moment we are loading the common file using a require command and it all seems to work fine. I know its not the best way of constructing this, but I have not got the time to convert it to a module at the moment.
Is it possible for this common file to work out if it is been called from one of the applications using the require, or if some one has accessed it directly from the Web Server?
I want to be able to make it output a warning to users who try and access it directly. Ideally I would like to move it into a directory not accessible by the web server, but I am not going to be able to move it at this point.
Any ideas would be greatly received.
Many Thanks,
Alistair
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Called by Require or Not
by merlyn (Sage) on Aug 06, 2004 at 16:09 UTC | |
|
Re: Called by Require or Not (robust)
by tye (Sage) on Aug 06, 2004 at 16:52 UTC | |
|
Re: Called by Require or Not
by Fletch (Bishop) on Aug 06, 2004 at 16:01 UTC |