LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-07-2004, 02:20 AM   #1
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Rep: Reputation: 15
perl cgi


Hi,
I have written a perl cgi but its not running at all!
When I link to it in konquerer kwrite opens as a document. In Mozilla the text of the cgi is opened in a browser window.

I have the first lines as:

#!/usr/bin/perl

and I have the Content-type line.

Please, any sufgestions?

TIA.
Neil.
 
Old 07-07-2004, 02:40 AM   #2
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
More info.

first lines say,

#!/usr/bin/perl
print "Content-type: text/html\n\n";
require("CGI.pm");

Cheers.
 
Old 07-07-2004, 03:48 AM   #3
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
Sorted.
The script fails but hey the browsers find it now.

renamed script to .cgi and placed in /var/www/cgi-bin/

checked permissions, which were ok.

Changed the refferring link to /cgi-bin/script.cgi

Now all works.
cheers
 
Old 07-07-2004, 04:52 AM   #4
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
For anyones else reference.

http://www.perl.com/doc/FAQs/cgi/idiots-guide.html
 
  


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 CGI:Can't locate CGI.pm supermyself Programming 13 09-10-2007 06:22 AM
perl cgi developers emailssent Programming 1 07-24-2005 02:23 PM
CGI -PERL Problem!!! lewkh Fedora 3 05-10-2005 12:19 AM
cgi perl : I cant get perl to append my html file... the_y_man Programming 3 03-22-2004 05:07 AM
cgi+perl barbanero General 0 04-07-2002 12:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:22 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