Google Answers Logo
View Question
 
Q: Perl question -- I don't understand Bootstrapping / Dynaloader ( No Answer,   1 Comment )
Question  
Subject: Perl question -- I don't understand Bootstrapping / Dynaloader
Category: Computers > Programming
Asked by: unclejimbo9-ga
List Price: $14.50
Posted: 24 Dec 2005 20:12 PST
Expires: 23 Jan 2006 20:12 PST
Question ID: 609590
Hi, I need help putting together a sample script. I am programming on
Win32 and on Mac OS X and using the same perl scripts on both.

On the Mac I have a file /myproject/include/ProjTools.pm and on the PC
I have the same file stored as C:\documents and
settings\admin\myproject\include\ProjTools.pm.

The bad way to start my scripts out would be 
use lib "/myproject/include";
use lib "C:\Documents And Settings\admin\myproject\include";
use ProjTools;

I know that there is a way I can set up a master module that does all
the "use lib"s for me, so my code would look like:

use Master:Module;
use ProjTools;

and none of my scripts would ever contain the text "use lib" and they
would never worry about what OS they were on -- they would just know
that Master:Module takes care of everything. I do not know what that
way is.

I'm pretty sure Master:Module will have to use Dynaloader and
bootstrapping, but I don't know exactly how. Can you guys figure out
what I'm trying to do and provide me a sample that cleans up what I
was doing above?

Thanks
Answer  
There is no answer at this time.

Comments  
Subject: Re: Perl question -- I don't understand Bootstrapping / Dynaloader
From: wordless-ga on 26 Dec 2005 05:02 PST
 
I don't think you need Dynaloader. Just add "C:\Documents And
Settings\admin\myproject\include" into the @INC array and you can use
projTools. Or you can set the environment variable PERL5LIB to
"C:\Documents And Settings\admin\myproject\include".

In my humble option, Dynaloader is needed when you want to dynamically
loading DLLs into perl code.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy