CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Installing a module

 



testerV
Novice

Aug 9, 2012, 2:26 PM

Post #1 of 6 (1303 views)
Installing a module Can't Post

Hi,
I need to use a module but I have to install the module not to a Perl folder but some ware on the network.
I thought I could use a few extra lines in my script to use that module.
It does not work.
Could you help me please?
Thanks, testerV

#!/usr/bin/perl -w
use strict;
use warnings;
use File::Find;
use File::Copy;
use File::Rsync;

my $modules ='C:\\Perl_Modules\\File-Rsync-0.42'; ## this is the module I want to use ##
BEGIN {
$scriptPath = "C:\\PERL_TEST\\TestFile_Dirr\\Module.pl"; ## this is my script ##
unshift(@INC,"$scriptPath $mod");
print "@INC are paths\n";}

Code



      
    


FishMonger
Veteran / Moderator

Aug 9, 2012, 2:57 PM

Post #2 of 6 (1300 views)
Re: [testerV] Installing a module [In reply to] Can't Post

I'm not sure if you need help with installing the module into a custom location, or the proper syntax in the script to load modules located in the custom directory.

To load the module in the script you'll want to use the lib pragma to add the custom directory to the @INC path prior to loading the module.

example

Code
use lib 'C:/Perl_Modules'; 
use File::Rsync;


To install a module to a custom directory, you need to set the PREFIX option in the call to Makefile.PL

This page covers several methods of installing modules.
http://www.perlmonks.org/index.pl?node_id=128077


(This post was edited by FishMonger on Aug 9, 2012, 2:58 PM)


testerV
Novice

Aug 9, 2012, 3:11 PM

Post #3 of 6 (1296 views)
Re: [FishMonger] Installing a module [In reply to] Can't Post

Thanks Fish!


testerV
Novice

Aug 9, 2012, 4:58 PM

Post #4 of 6 (1292 views)
Re: [testerV] Installing a module [In reply to] Can't Post

By the way, does anybody know a good tutorial on rsync?
Thanks, testerV


FishMonger
Veteran / Moderator

Aug 9, 2012, 6:04 PM

Post #5 of 6 (1288 views)
Re: [testerV] Installing a module [In reply to] Can't Post

The first 4 hits on a simple google search for "rsync examples" are all good and took less time to find and review them than it takes to post the request for examples.

http://www.comentum.com/rsync.html
https://calomel.org/rsync_tips.html
http://www.thegeekstuff.com/2010/09/rsync-command-examples/
http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/


testerV
Novice

Aug 9, 2012, 6:52 PM

Post #6 of 6 (1286 views)
Re: [FishMonger] Installing a module [In reply to] Can't Post

Thanks Fish, Iíve seen them, they are all for UNIX.
Iím looking for Windows tutorials.
testerV

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives