# CGI scripting Error

**URL:** <https://community.unix.com/t/cgi-scripting-error/252255>\
**Category:** Shell Programming and Scripting\
**Created:** [October 28, 2009, 9:53am UTC](https://community.unix.com/t/cgi-scripting-error/252255 "2009-10-28T09:53:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhavesh.sapra](https://community.unix.com/letter_avatar/bhavesh.sapra/32/5_5575768a8748004e209b776fc1b2916d.png) [@bhavesh.sapra](https://community.unix.com/u/bhavesh.sapra)\
**Post date:** [October 28, 2009, 9:53am UTC](https://community.unix.com/t/cgi-scripting-error/252255/1 "2009-10-28T09:53:48Z")

</div>

I am trying to execute following program

```nohighlight
#!/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 😕  
and it says syntax is ok.

---

<div class="post-metadata">

**Author:** ![cfajohnson](https://community.unix.com/user_avatar/community.unix.com/cfajohnson/32/16669_2.png) [@cfajohnson](https://community.unix.com/u/cfajohnson)\
**Post date:** [October 28, 2009, 2:00pm UTC](https://community.unix.com/t/cgi-scripting-error/252255/2 "2009-10-28T14:00:44Z")

</div>

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

The equivalent shell script CGI is:

```nohighlight
printf "Content-type: text/html\n\n"

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

```

---

<div class="post-metadata">

**Author:** ![bhavesh.sapra](https://community.unix.com/letter_avatar/bhavesh.sapra/32/5_5575768a8748004e209b776fc1b2916d.png) [@bhavesh.sapra](https://community.unix.com/u/bhavesh.sapra)\
**Post date:** [October 29, 2009, 5:15am UTC](https://community.unix.com/t/cgi-scripting-error/252255/3 "2009-10-29T05:15:00Z")

</div>

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.😉

---

<div class="post-metadata">

**Author:** ![pludi](https://community.unix.com/user_avatar/community.unix.com/pludi/32/1278_2.png) [@pludi](https://community.unix.com/u/pludi)\
**Post date:** [October 29, 2009, 6:20am UTC](https://community.unix.com/t/cgi-scripting-error/252255/4 "2009-10-29T06:20:43Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![bhavesh.sapra](https://community.unix.com/letter_avatar/bhavesh.sapra/32/5_5575768a8748004e209b776fc1b2916d.png) [@bhavesh.sapra](https://community.unix.com/u/bhavesh.sapra)\
**Post date:** [October 29, 2009, 6:59am UTC](https://community.unix.com/t/cgi-scripting-error/252255/5 "2009-10-29T06:59:58Z")

</div>

Hi pludi, thanks for your quick reply, it worked.🙂  
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.
