LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   perl module install? (https://www.linuxquestions.org/questions/linux-newbie-8/perl-module-install-75820/)

DKY 07-25-2003 09:09 AM

perl module install?
 
How do I know if perl is installed, and running with my redhat. I just got the server working, and if there are any perl files that need to be installed, I think I installed them. With my windoze machine, I used to do a ppm sort of thing to install modules, If I have perl installed, how do I install perl modules?

jharris 07-25-2003 09:20 AM

If you run perl -V the bottom of the output will mention @INC and list a number of directories. Your modules will be held below these dirs so you can just look through them, or run a find on the module names. I tend to find it easier to just write a little perl script that tries to 'use' the modules.

cheers

Jamie...

DKY 07-25-2003 09:50 AM

okay, so what do you mean by tries to "use" the modules. So then it would list them? Also, how would I go about installing a module, like the DB_File. The perl -V (I didnt know it was case sensetive) says I'm running version 5.8.0

jharris 07-25-2003 10:00 AM

When I say "use" a module I mean literally have a script that says somethinglike
Code:

#!/usr/bin/perl -w

use Digest::MD5

In this case it would attempt to use the Digest::MD5 module. The easiest way I've found to install modules is to run perl -MCPAN -e shell then type install moduleName where moduleName is literally the name of the module.

Runing perl -v will just show you the version, perl -V will give you the extra info. Just about everything should be assumed to be case sensitive as most things under Linux (and Unix in general) are case sensitive.

cheers

Jamie...

DKY 07-25-2003 10:38 AM

now, I'm trying to run a cgi file in my browser, and I can't figure out what the path is for the shebang. Can I do a search for files? If so, what exactly am I searching for. Not Perl.exe, right?

jharris 07-25-2003 10:59 AM

You are just looking for perl - Linux doesn't use file extensions to identify wether a file is executable. I would expect you to find it as either /usr/bin/perl or /usr/local/bin/perl or possibly both. If you want to search for it use the following
Code:

find / -type f  -name perl
cheers

Jamie...

DKY 07-25-2003 11:42 AM

it says my path is
Code:

/usr/bin/perl
but I can't get a cgi file to run in the cgi-bin, any clue why?
http://dky.sytes.net/cgi-bin/iBtest.cgiit

stickman 07-25-2003 03:56 PM

You should be able to find a hint about the problem in your Apache logs. Can you run the script from command line and get HTML output?

DKY 07-26-2003 08:05 AM

Quote:

Can you run the script from command line and get HTML output?
how do I do that?

and where are the logs located?

MasterC 07-26-2003 08:16 AM

Quote:

Originally posted by DKY
and where are the logs located?
Whoa! Logs are a webmaster's best friend ;)

You will usually find where they are located defined within your httpd.conf file. To just guess though:
/var/log/apache
And you could also search:
locate apach.log
locate apache_log
OR just
locate apache | less

:)

Cool

DKY 07-31-2003 01:06 PM

my log says this
Quote:

[Thu Jul 31 13:05:03 2003] [error] [client 192.168.1.1] Premature end of script headers: iBtest.cgi
any idea what that means?

jharris 08-01-2003 07:53 AM

What are the top few lines of iBtest.cgi?

cheers

Jamie...

stickman 08-01-2003 08:22 AM

Quote:

Originally posted by DKY
how do I do that?

Go to your script directory and do something like:
./iBtest.cgi

One caveat to this method is that it sometimes breaks if your CGI requires certain input.

DKY 08-02-2003 08:17 AM

here's what happened when I tried to run the script.

./iBtest.cgi
: bad interpreter: No such file or directory





top few lines look something like so
Code:

#!/usr/bin/perl



# Change the above line to reflect your server's path to perl



##########################################################################

# This script checks your paths, prints them and also any environment

# variables.  Useful for troubleshooting purposes.

#

# Copyright 2001, 2002 Luke Dawson for Ikonboard,  Jarvis Entertainment Group, inc

##########################################################################



use CGI::Carp "fatalsToBrowser";



use strict;

no strict "vars";



require CGI;


elam 08-02-2003 11:20 AM

You have to be in the directory where iBest.cgi resides when you issue the iBtest.cgi command.
You can pass along cgi variables if you like with:

./iBtest.cgi color=red name=joe submit=submit

and so on.

If you can run it from the command line, then odds are its a permissions problem.


All times are GMT -5. The time now is 07:41 PM.