A colleague has just given me the answer (used in other Perl scripts here):
The code making the choice needs to be in the BEGIN block, but the 'use lib' needs not to be.
I didn't realise that a BEGIN block is run before compiling the rest of the file.
Colin Fine
Engineering Tools Group...
Thanks, that's very helpful for confirming what's going on.
Your suggestions all seem to assume that I'm using mod_perl, which I'm not.
Colin
Colin Fine
Engineering Tools Group
Pace Micro Technology plc
www.pace.co.uk
The immediate question:
Is there a way I can set the library path depending on %ENV (specifically some HTTP/HTML $ENV's) in time to control the loading of Perl modules?
Background:
I have a CGI script, and a whole slew of locally written Perl modules. The script contains a suitable
use lib...
Basically, if you are looking at a webpage, you are in the hands of your web browser (IE, Mozilla, Opera, Firefox, whatever), and you have whatever facilities it provides you.
There may be ways of attaching programs or scripts to your mouse button, but I wouldn't bank on it.
Sorry.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.