Solved

new to cgi

Posted on 2003-12-03
6
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

751 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