Visit Our UNIX and Linux User Community


Calling privately installed module from script help please


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Calling privately installed module from script help please
# 1  
Old 02-08-2002
Question Calling privately installed module from script help please

hello,

i need help calling a privately installed module from a script. my server admin installed perl with the standard modules and simply no extras, including the LWP::Simple mod i need. (side note: ive asked for it to be installed).

in the meantime, i installed it (libwww-perl-5.62.tar.gz) into a privately created directory called 'myperl', using the steps decompress, unpack, build, install. on the 'build' step i entered:

$ perl Makefile.PL LIB=/home/virtual/admin/home/httpd/cgi-bin/myperl PREFIX=/home/virtual/admin/home/httpd/cgi-bin/myperl

everything seemed to work well... all mods are there.

my script (which is in cgi-bin/print directory) reads:

require 5;
use LWP::Simple;

cpan says to use one of the following:

1] foo@barbell$ setenv PERL5LIB /path/to/module sets the environment variable PERL5LIB.

2] use lib qw(/path/to/module); used at the top of your script tells perl where to find your module.

3] foo@barbell$ perl -I/path/to/module

in my script ive typed (one example of many variations ive tried):

require 5;
use LWP::Simple qw(/home/virtual/sbcadmin/home/httpd/cgi-bin/myperl/LWP/Simple.pm);

SIDE NOTE: my server info: Red Hat Linux release 6.0 (Hedwig)
Kernel 2.2.12-20ensim on an i686

is this simply something i cannot do without admin and root privileges or is my syntax incorrect somewhere?

thanks in advance,
sdiva
# 2  
Old 02-09-2002
Re: Calling privately installed module from script help please

Quote:
Originally posted by sdiva

in my script ive typed (one example of many variations ive tried):

require 5;
use 'LWP::Simple qw(/home/virtual/sbcadmin/home/httpd/cgi-bin/myperl/LWP/Simple.pm);

SIDE NOTE: my server info: Red Hat Linux release 6.0 (Hedwig)
Kernel 2.2.12-20ensim on an i686

is this simply something i cannot do without admin and root privileges or is my syntax incorrect somewhere?

thanks in advance,
sdiva [/B]
try:

require 5; #perl 5 or >
use lib '/home/virtual/sbcadmin/home/httpd/cgi-bin/myperl';

use LWP::Simple;

# 3  
Old 02-09-2002
It worked perfectly. Thank you very much for the help!

sdiva
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #61
Difficulty: Easy
A computer on a LAN segment is uniquely identified by its MAC address.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash find version of an installed application but if none is found set variable to App Not Installed

Hello Forum, I'm issuing a one line bash command to look for the version of an installed application and saving the result to a variable like so: APP=application --version But if the application is not installed I want to return to my variable that the Application is not installed. So I'm... (2 Replies)
Discussion started by: greavette
2 Replies

2. Shell Programming and Scripting

PERL: Calling a sub routine from another module - help!!!

Hi, I am an occasional PERL user. I am trying to call a sub routine (passing parameters) in perl module from a driver .pl file. I have been "tinkering" for a while now and have confused myself. Could someone please look at the code below and spot where I am going wrong. testPerl.pl ... (0 Replies)
Discussion started by: chris01010
0 Replies

3. Shell Programming and Scripting

calling a shell script present on another server using perl script.

Hi, I am working on a sever A. I want to write a perl script to execute a shell script persent on the server B. please help me in this. thanks in advance. (3 Replies)
Discussion started by: anandgodse
3 Replies

4. Shell Programming and Scripting

Calling a Perl script in a Bash script -Odd Situation

I am creating a startup script for an application. This application's startup script is in bash. It will also need to call a perl script (which I will not be able to modify) for the application environment prior to calling the application. The problem is that this perl script creates a new shell... (5 Replies)
Discussion started by: leepet01
5 Replies

5. Red Hat

Trouble with installed / not installed rpm unixODBC/libodbc.so.1

Hey there, i run 1: on my server (RHEL 6) and getting response that the libodbc is not installed. If i use yum for installation, it tells me, there is no package like this ( 2: ). Since in the description of Definiens is mentioned that the Run-time dependency is unixODBC (libodbc.so.1), I assume... (2 Replies)
Discussion started by: rkirsten
2 Replies

6. Shell Programming and Scripting

calling perl subroutine from perl expect module

All, Is it possible to call a subroutine from the perl expect module after logging to a system that is within the same program. My situation is I need to run a logic inside a machine that I'm logging in using the expect module, the logic is also available in the same expect program. Thanks,... (5 Replies)
Discussion started by: arun_maffy
5 Replies

7. Shell Programming and Scripting

Running a unix script(which is calling another script inside that) in background

Hi all, I am having a script ScriptA which is calling a script ScriptB in the same server and copying files to second server and have to execute one script ScriptC in the second server. THis First script ScriptA is the main script and i have to execute this process continously. for Keeping... (2 Replies)
Discussion started by: rohithji
2 Replies

8. Linux

How to convert Linux Kernel built-in module into a loadable module

Hi all, I am working on USB data monitoring on Fedora Core 9. Kernel 2.6.25 has a built-in module (the one that isn't loadable, but compiles and links statically with the kernel during compilation) to snoop USB data. It is in <kernel_source_code>/drivers/usb/mon/. I need to know if I can... (0 Replies)
Discussion started by: anitemp
0 Replies

9. UNIX for Dummies Questions & Answers

Howto locate locally installed Perl module for a CGI script in APACHE .htaccess

Hi, I have the following simple CGI script, just containg header: #!/usr/bin/perl -w use CGI ':standard'; use lib "/home/myname/lib/perl5/site_perl/5.8.5/"; use Mail::Sendmail; I also have included this directive in ~/public_html/.htaccess : SetEnv PERL5LIB... (0 Replies)
Discussion started by: monkfan
0 Replies

10. Shell Programming and Scripting

Correct Syntax For Calling Shell Script in Perl Module

Problem: I have a shell script that will be called by a Perl module that will connect to a db and delete rows. The Perl module will be called by CRON. I am using a Perl module to call a shell script because I need to get the db connection from Perl. Here is the Perl pseudocode: ... (4 Replies)
Discussion started by: mh53j_fe
4 Replies

Featured Tech Videos