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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
07-25-2003, 09:09 AM
|
#1
|
Member
Registered: Jul 2003
Posts: 60
Rep:
|
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?
|
|
|
07-25-2003, 09:20 AM
|
#2
|
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243
Rep:
|
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.
|
|
|
07-25-2003, 09:50 AM
|
#3
|
Member
Registered: Jul 2003
Posts: 60
Original Poster
Rep:
|
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
|
|
|
07-25-2003, 10:00 AM
|
#4
|
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243
Rep:
|
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.
|
|
|
07-25-2003, 10:38 AM
|
#5
|
Member
Registered: Jul 2003
Posts: 60
Original Poster
Rep:
|
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?
|
|
|
07-25-2003, 10:59 AM
|
#6
|
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243
Rep:
|
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...
|
|
|
07-25-2003, 03:56 PM
|
#8
|
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552
Rep:
|
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?
|
|
|
07-26-2003, 08:05 AM
|
#9
|
Member
Registered: Jul 2003
Posts: 60
Original Poster
Rep:
|
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.
|
|
|
07-26-2003, 08:16 AM
|
#10
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
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
|
|
|
07-31-2003, 01:06 PM
|
#11
|
Member
Registered: Jul 2003
Posts: 60
Original Poster
Rep:
|
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.
|
|
|
08-01-2003, 07:53 AM
|
#12
|
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243
Rep:
|
What are the top few lines of iBtest.cgi?
cheers
Jamie...
|
|
|
08-01-2003, 08:22 AM
|
#13
|
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552
Rep:
|
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.
|
|
|
08-02-2003, 08:17 AM
|
#14
|
Member
Registered: Jul 2003
Posts: 60
Original Poster
Rep:
|
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;
|
|
|
08-02-2003, 11:20 AM
|
#15
|
LQ Newbie
Registered: Aug 2003
Posts: 21
Rep:
|
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 06:43 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|