perl\site\lib\auto\... (DLLs, LIB, EXP etc) to another location under your dev directory?

K

Kenjis Kaan

Would it be possible to move support files under
perl\site\lib\auto\... (DLLs, LIB, EXP etc) to another location
under your dev directory? I am developing perl applications that will
then be pushed down to end users PC as a package. I need to make this
package self contained so that when it sits on the client PC it can be
run right away. The problem is that there is only a basic Perl
installation on the end users PC with non of the fancy modules
installed. So I would like to be able to create my application in
such a way that I can put the DLLs/LIB of the package in the current
directory, as well as the module.pm itself. I wonder if perl will
allow you to do that. I notice whenever I install a package, it puts
all the DLLs,LIB files into the perl\site\lib\auto directory. I don't
want ot have to go and install various package on thousands of PCs
before an application can be run. There has to be a way so that you
can put the DLLs eg. DB_File.dll and DB_File.lib inside the current
development directory containing the codes I am developing. So when I
hand the complete product over to who ever use it, the thing will run
right away. You just can't expect end user to know how to install
perl packages.
 
R

Randy Kobes

Kenjis Kaan said:
Would it be possible to move support files under
perl\site\lib\auto\... (DLLs, LIB, EXP etc) to another location
under your dev directory?
[ ... ]
If your users are running ActivePerl, you can create a ppm package
(http://aspn.activestate.com/ASPN/docs/ActivePerl/faq/ActivePerl-faq2.html)
which users can install with the ppm utility. Alternatively, after
building the package, you could distribute the blib/ directory,
which users can then include as, eg, 'perl -Mblib ...'.

best regards,
randy kobes
 
K

Kenjis Kaan

Randy Kobes said:
Kenjis Kaan said:
Would it be possible to move support files under
perl\site\lib\auto\... (DLLs, LIB, EXP etc) to another location
under your dev directory?
[ ... ]
If your users are running ActivePerl, you can create a ppm package
(http://aspn.activestate.com/ASPN/docs/ActivePerl/faq/ActivePerl-faq2.html)
which users can install with the ppm utility.
Alternatively, after
building the package, you could distribute the blib/ directory,
which users can then include as, eg, 'perl -Mblib ...'.

best regards,
randy kobes

Thanks for you reply. How would you do this second alternative, ie
distribute the blib/ directory. I guess when you say blib/ you mean
/perl/site/lib
I am in fact using ActivePerl 5.6.x
 
S

Sisyphus

Kenjis Kaan said:
"Randy Kobes" <[email protected]> wrote in message
Kenjis Kaan said:
Would it be possible to move support files under
perl\site\lib\auto\... (DLLs, LIB, EXP etc) to another location
under your dev directory?
[ ... ]
If your users are running ActivePerl, you can create a ppm package
(http://aspn.activestate.com/ASPN/docs/ActivePerl/faq/ActivePerl-faq2.html)
which users can install with the ppm utility.
Alternatively, after
building the package, you could distribute the blib/ directory,
which users can then include as, eg, 'perl -Mblib ...'.

best regards,
randy kobes

Thanks for you reply. How would you do this second alternative, ie
distribute the blib/ directory. I guess when you say blib/ you mean
/perl/site/lib
I am in fact using ActivePerl 5.6.x

No, the 'blib' is created when you build a module from source.

for(@INC) {print $_, "\n"}

If you run that you'll normally find that there are 3 @INC folders - your
'/perl/lib/' folder, your '/perl/site/lib/' folder, and '.', which is the
current working directory.

If you're script uses a module called Bogus::Rubbish, then perl will look
for Rubbish.pm in the '$INC[0]/Bogus/' folder, then the '$INC[1]/Bogus/'
folder, and lastly the '$INC[2]/Bogus/' folder (ie './Bogus/').

It will look for Rubbish.dll in the
'$INC[0]/auto/Bogus/Rubbish/' folder, then the
'$INC[1]/auto/Bogus/Rubbish/' folder, and lastly in the
'$INC[2]/auto/Bogus/Rubbish/' folder.

So you would need to ensure that Rubbish.pm and Rubbish.dll are installed in
one of those locations on the user's PC.

Alternatively you could insist that the user place Rubbish.pm in
'C:/some_folder/Bogus/' and Rubbish.dll in
'C:/some_folder/auto/Bogus/Rubbish/' - and include in the script that they
are running:
use lib 'C:/some_folder';

(see perldoc lib.)

Hth.

Cheers,
Rob
 
R

Randy Kobes

Kenjis Kaan said:
"Randy Kobes" <[email protected]> wrote in message
Kenjis Kaan said:
Would it be possible to move support files under
perl\site\lib\auto\... (DLLs, LIB, EXP etc) to another location
under your dev directory?
[ ... ]
Alternatively, after
building the package, you could distribute the blib/ directory,
which users can then include as, eg, 'perl -Mblib ...'.

Thanks for you reply. How would you do this second alternative, ie
distribute the blib/ directory. I guess when you say blib/ you mean
/perl/site/lib
I am in fact using ActivePerl 5.6.x

As Rob mentioned, the blib directory is created within
the package's source directory upon building. This isn't
meant to be a permanent solution, but in principle, what
you could do is transfer the entire blib directory to some other
machine (which runs the same Perl version as the original),
and then run your script as
perl -Mblib your_script
or
perl -Mblib=dir your_script
depending on where you put the blib directory. This adjusts
@INC so as to include the appropriate directories under blib.
See 'perldoc blib' for more details.

best regards,
randy
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top