LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-25-2003, 09:09 AM   #1
DKY
Member
 
Registered: Jul 2003
Posts: 60

Rep: Reputation: 15
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?
 
Old 07-25-2003, 09:20 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
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...

Last edited by jharris; 07-25-2003 at 09:21 AM.
 
Old 07-25-2003, 09:50 AM   #3
DKY
Member
 
Registered: Jul 2003
Posts: 60

Original Poster
Rep: Reputation: 15
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
 
Old 07-25-2003, 10:00 AM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
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...

Last edited by jharris; 07-25-2003 at 10:01 AM.
 
Old 07-25-2003, 10:38 AM   #5
DKY
Member
 
Registered: Jul 2003
Posts: 60

Original Poster
Rep: Reputation: 15
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?
 
Old 07-25-2003, 10:59 AM   #6
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
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...
 
Old 07-25-2003, 11:42 AM   #7
DKY
Member
 
Registered: Jul 2003
Posts: 60

Original Poster
Rep: Reputation: 15
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
 
Old 07-25-2003, 03:56 PM   #8
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
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?
 
Old 07-26-2003, 08:05 AM   #9
DKY
Member
 
Registered: Jul 2003
Posts: 60

Original Poster
Rep: Reputation: 15
Quote:
Can you run the script from command line and get HTML output?
how do I do that?

and where are the logs located?

Last edited by DKY; 07-26-2003 at 08:08 AM.
 
Old 07-26-2003, 08:16 AM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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
 
Old 07-31-2003, 01:06 PM   #11
DKY
Member
 
Registered: Jul 2003
Posts: 60

Original Poster
Rep: Reputation: 15
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?

Last edited by DKY; 07-31-2003 at 01:08 PM.
 
Old 08-01-2003, 07:53 AM   #12
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
What are the top few lines of iBtest.cgi?

cheers

Jamie...
 
Old 08-01-2003, 08:22 AM   #13
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
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.
 
Old 08-02-2003, 08:17 AM   #14
DKY
Member
 
Registered: Jul 2003
Posts: 60

Original Poster
Rep: Reputation: 15
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;
 
Old 08-02-2003, 11:20 AM   #15
elam
LQ Newbie
 
Registered: Aug 2003
Posts: 21

Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl Module cant Install sohaib Red Hat 6 12-02-2005 09:22 AM
Unable to install Perl module via CPAN Sparky.Watson Linux - Software 1 08-24-2005 08:23 PM
Install perl module mosh Programming 2 06-21-2004 12:12 PM
Perl and GD module install problem timfair Linux - Software 0 09-17-2003 08:47 PM
perl-module Net::RawIP - install problem nic_d Linux - Software 0 07-06-2002 07:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration