Solved

new to cgi

Posted on 2003-12-03
6
357 Views
Last Modified: 2013-12-25
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
Comment
Question by:soft_techy
  • 2
6 Comments
 
LVL 3

Expert Comment

by:mrh30
ID: 9873586
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
 
LVL 1

Author Comment

by:soft_techy
ID: 9874700
Can u help me setup simple dynamic web page(may be displaying date) on tomcat using perl.. I dunno about directory structure.

Thanks
0
 
LVL 3

Accepted Solution

by:
mrh30 earned 125 total points
ID: 9874732
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
 
LVL 3

Assisted Solution

by:rkosai
rkosai earned 125 total points
ID: 9893221
>  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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now