Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

installing and using perl module/library

Status
Not open for further replies.

hosrow

Programmer
May 18, 1999
16
US
I have downloaded and installed libnet perl library (my main interest is NET::FTP)on my local working directory using:<br>
<br>
perl Makefile.PL PREFIX=~/perl<br>
<br>
This created a /perl in my home directory.<br>
<br>
How can I get my Perl script to recognize where to look for the contents of this library, namely the FTP module. In my program I have included:<br>
<br>
#!/use/local/lib/perl -w <br>
use NET::FTP;<br>
<br>
This gives me an error saying that Net/FTP.pm not found in @INC.<br>
<br>
Please give me ideas. I am stuck !!! :)<br>
<br>
Thanks,<br>
<br>
Hosrow
 
first line of your example "#!/use/local/lib/perl -w" should that read "#!/usr/local/lib/perl -w"? (usr and not use in the path)<br>
<br>
Anyway - Had you thought of writing a perl program to print the values of @INC?<br>
<br>
Mike<br>

 
i don't think this work cos i've tried it, it only prints out @INC dirname at dirname
 
like this I meant
foreach (@INC){
print &quot;$_\n&quot;;
} Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
You can modify @INC at runtime if you really want. In your case you would say,

push(@INC, &quot;/home/username/perl&quot;);

then you library would be found in @INC. It is not recommended you do this (though there are some who do).

The other way is to stick - use lib &quot;/home/username/perl&quot;;
then put your use NET::FTP statement.

Your line #!/usr/local/lib/perl seems a bit suspect since this line is supposed to point your perl binary i.e.,

#!/usr/local/bin/perl

(course I might be putting my foot in it there :))

Just for interest and 'cos I think it's elegant, the following will print @INC from the command line;

perl -e 'map{print $_ . &quot;\n&quot;} @INC' (in Linux, Unix type OS)



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top