CGI scripting Error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting CGI scripting Error
# 1  
Old 10-28-2009
CGI scripting Error

I am trying to execute following program

Code:
#!/usr/bin/perl -wT
use CGI qw(:standard);
print start_html("Hello world");

and getting an error (offline mode: enter name=value pairs on standard input)

i am a beginner so please try to explain it as much as possible.

---------- Post updated at 09:53 AM ---------- Previous update was at 08:40 AM ----------

i have tried to check syntax by running command,
perl -cwT fourth.cgi Smilie
and it says syntax is ok.

Last edited by Franklin52; 10-29-2009 at 07:47 AM.. Reason: Please use code tags!
# 2  
Old 10-28-2009

What is the output of the script when you run it at the command line?

The equivalent shell script CGI is:

Code:
printf "Content-type: text/html\n\n"

printf "%s\n" "Hello, World!"

# 3  
Old 10-29-2009
Hi Johnson, thanks for your reply.
i am trying to run this CGI script on command line only i am not using any web server to check this script.
I would appreciate if you can help me further in this case.Smilie
# 4  
Old 10-29-2009
This isn't an error. Perls CGI module handles the conversion of form parameters, passed via the GET or POST method. Since you're calling it "offline" (not via the web browser), it has to obtain these parameters some other way (even if the script doesn't require them), so it asks for you to input them. If you don't have any parameters to pass, just press Control+D (EOF).
# 5  
Old 10-29-2009
Hi pludi, thanks for your quick reply, it worked.Smilie
but i am curious to know what all parameteres are sent through GET or POST, if you can help me with that.
Thanks in advance.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl CGI : unable to download the excel sheet from perl cgi page

Hi All, I have written an cgi perl script that displays an image(Excel image) and when clicked on that Image I need to download a excel sheet. I made sure that excel sheet exists in the folder with the given name but still I am not able to download the sheet. print "<center><table... (2 Replies)
Discussion started by: scriptscript
2 Replies

2. Shell Programming and Scripting

Perl cgi pages out of cgi-bin folder in WINDOWS

Hi team, I have a typical problem with cgi pages in apache webserver in WINDOWS I am able to execute(display) the pages that are saved in cgi-bin folder. But I am not able to execute the pages stored in htdocs or other folder other than cgi-bin folder. Could anyone please let me know how... (1 Reply)
Discussion started by: scriptscript
1 Replies

3. Shell Programming and Scripting

Web Service in Perl CGI scripting

Hi, I have a requirement to write web service in Perl CGi scripting.The web service will be called by some external programs.Any help would be appreciated.Sample hello world program will be more helpful. Thanks, Liyakath Ali. (1 Reply)
Discussion started by: liyakathali
1 Replies

4. Shell Programming and Scripting

Perl CGI Scripting

Hi, My below cgi script works fine from the command line but not working from the web browser. #!/usr/bin/perl use File::Copy; use CGI; print "Content-type: text/html\n\n"; print "<html><head><title>LOGS"; print "</title></head>"; print "<body bgcolor=#95B9C7 link=black>"; ... (4 Replies)
Discussion started by: liyakathali
4 Replies

5. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

6. Shell Programming and Scripting

cgi scripting help needed

hi all, i'm new to CGI scripting. I want to compute memory utilisation, so when i run free command in my cgi scipt, if memory is utlised more than 70%. i want to display in free command in html as red color free total used free shared buffers ... (1 Reply)
Discussion started by: raghur77
1 Replies

7. Solaris

apache ErrorDocument 400 /cgi-bin/400.cgi

Hi All, Sorry if the question is trivial for you but, I am new to Apache (2.0.63) and am trying to figure out how to display my 400.cgi. Here is what I have in httpd.conf servername testing DocumentRoot "/usr/local/apache2/htdocs" ErrorDocument 400 /cgi-bin/badrequest-400.cgi Here is... (0 Replies)
Discussion started by: afadaghi
0 Replies

8. Shell Programming and Scripting

Writing CGI scripting using perl

Hi All, I am trying to do the following thing. I am entering name & email id & then in action i am calling a .cgi program that sends a email to the email id entered. I am facing a small problem, once i have entered the details , its printing the contents of .cgi file in browser. there is a... (7 Replies)
Discussion started by: alma
7 Replies

9. Shell Programming and Scripting

CGI passing arrays/hashes to another CGI script

If I have a Perl CGI script (script01), which fills an array(s) with information and outputs a HTML page with a link to another CGI page (script02); is there anyway to pass the array(s) from "script01" to "script02" when the page visitor clicks the link? Hope that makes sense! :) (2 Replies)
Discussion started by: WIntellect
2 Replies
Login or Register to Ask a Question