Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: problem with module loading

by coreolyn (Parson)
on Jul 29, 2004 at 16:43 UTC ( [id://378428]=note: print w/replies, xml ) Need Help??


in reply to problem with module loading

Much ugliness! Really could have used better description of the problem, especially where it concerns the other module dependencies. The best I can do is through some psuedo code at you to hopefully get you thinking in a good direction

Basically you need a BEGIN loop to handle your dependencies. The following is real bulky and I have no doubts there are more efficient ways to do this, but I'm just trying to show 'a way' to get you started and it's strictly the first way to come to my head.

/usr/local/bin/perl -w use strict; BEGIN { # I'd put all the locations I want added into an array my @inINC = "/pathsToTheModulesIWant"; # I'd load all the current values into a different array my @initINC = "/defaultINCPaths"; # Then I'd have an array with all the values I want # pulled from @INC my @badINC = "/modules I don't want"; # (With the problems with interdependencies you may need # to move some modules to there own directory ) # I'd then loop through the initial array and load the # paths I want to keep my $initPath, $badINCPath; for $initPath (@initINC) { for $badINC (@badINC) { unless ( $badINC eq $initPath ); { push (@inINC, $initPath); } } } # Now that you have the order and values of the # paths you want, set @INC @INC = @inINC; } # and On with the programs regularly scheduled execution use x; use y;

Hope this or the criticism arising from this helps!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://378428]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-19 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found