Module Question

W

Wayne Happ

I have a question about finding a module at rutime.

Here's what I would like to do.

push(@INC, @notknowntillrunning);

use lib 'notknowntill running';

use foo;

My problem is I do not know the where the Module will be till the script
runs. Perl won't compile the script because at time of compilation the
enviroment is not known.

This is a corporate computing environment and I can't change the value of
@INC before running my script. (It's a policy thing.)

Any ideas on how to get the same effect?

Wayne
 
R

Randal L. Schwartz

Wayne> Any ideas on how to get the same effect?

First, comp.lang.perl has been dead for ten years. You probably
want comp.lang.perl.misc instead.

Second, you haven't said *how* you would determine the location of
the module. But maybe this will help:

BEGIN {
my $module_location = magical_function_or_sequence_you_did_not_describe();
push @INC, $module_location;
}

use Module::Found::In::Extra::Location;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top