Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: How to run a CGI perl script?
11-18-2011, 10:35 AM #1
- Join Date
- Nov 2011
- Thanked 0 Times in 0 Posts
How to run a CGI perl script?
hello to all,
I am really stuck in a problem.I have learned Perl and HTML and am now moving to learn CGI perl.
I am able to understand the problem, but am unable to understand how to execute these programs.
also I am confused that actually the CGI Perl files are saved as only .cgi extention???
If yes, then what are those programs that have a HTML part linked to a perl program. Those are also not running properly. Opening the HTML page links the perl program, but the program does not run, and the complete program appears on the HTML page itself.
Please help me out.
Regards and Thanx in advance.
11-19-2011, 03:55 PM #2
- Join Date
- Jan 2010
- Thanked 13 Times in 13 Posts
Tell us more about your setup. Do you have HTTP software, and what is it? Apache is an example HTTP server.
Put your Perl scripts in your cgi-bin folder, then you can access them by going to that directory. For example, if you put a script named helloworld.cgi in the cgi-bin, you access it like this:
<form action="http://www.example.com/cgi-bin/helloworld.cgi" method="post">
#!/usr/local/bin/perl print "Content-type: text/html\n\n"
Last edited by hey; 11-19-2011 at 04:04 PM.