Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

new to cgi

Hi I have developed web applications using JAVA , JSP . but never into cgi  programming for dynamic content.

Most of the times i worked on Windows. Can somebody let me know how can i create sample dynamic webpage that displays current date using perl?

I have following questions
1)Which server i have to use??(I currently use apache tomcat for my java sites)
2)Do i have to have unix on my system
3)Is there any resource on internet to guide step by step

One of my friend has his website hosted on one of the hosting companies.He wants me to add dynamic content like uploading files , his hosting company has cgi scripting support. I want to know the procedure of how i can run my scripts on those

Thanks
0
soft_techy
Asked:
soft_techy
  • 2
2 Solutions
 
mrh30Commented:
1) Almost every web server will have support for Perl.
2) Perl will run under Windows as well as Unix, but I've only ever run it under Unix and I don't really know how to get it running under Windows.
3) Your best bet would be to start at the following:

http://www.perl.com

Or get hold of either of the big two O'Reilly Perl books (Llama book and Camel book).
0
 
soft_techyAuthor Commented:
Can u help me setup simple dynamic web page(may be displaying date) on tomcat using perl.. I dunno about directory structure.

Thanks
0
 
mrh30Commented:
On our webserver, we put scripts in a /cgi-bin directory within the website's directory structure.  A Perl script to display the date might then look something like:

#!/usr/bin/perl -w

use strict;
use CGI;

my $q = new CGI();

print $q->header();
print gmtime;

I don't know the specifics of setting tomcat up for Perl I'm afraid.  You'll have to go look it up.
0
 
rkosaiCommented:
>  Hi I have developed web applications using JAVA , JSP . but never into cgi  programming for dynamic content.

JSP is a form of CGI programming.  Using the Tomcat server, you use Java to create web content.  CGI only stands for common gateway interface, and is not language specific.

However, when a web hosting company says they have CGI scripting support, they usually mean that they have Perl CGI support.  You don't have to do any set up for this support, simply load the scripts into a cgi-bin directory (or even in the main web directory for some hosting companies), and change the permissions so that the files have "Execute" permissions (755 tends to be the one I use).

If you want to set up your own CGI-Perl scripting environment, even under a Windows server, it is usually easiest to set up Apache.  Tomcat is a Java servlet container not related to Perl/CGI content, so you'll just be using Perl to run the scripts.  You can download a good windows version of Perl from www.activestate.com (It is called ActivePerl).  This does not require Unix or any Unix-like system (including Cygwin).
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now