WebDeveloper.com ®: Where Web Developers and Designers Learn How to Build Web Sites, Program in Java and JavaScript, and More!   
Web Developer Resource DirectoryWebDev Jobs  
Animated GIFs
CSS
CSS Properties
Database
Design
Flash
HTML
HTML 4.01 Tags
JavaScript
.NET
PHP
Reference
Security
Site Management
Video
XML/RSS
WD Forums
 Client-Side
  Development

    CSS
    Graphics
    HTML
    JavaScript
    XML
    Dreamweaver/FrontPage
    Multimedia
    Web Video
    General
    Accessibility

 Server-Side
  Development

    ASP
    Perl
    PHP
    .NET
    Java
    SQL
    Other

 Web Development
  Business Issues

    Business Matters
    Website Reviews

 E-Commerce
    Domain Names
    Search Engines

 Etc.
    Computer Issues
    Forum Software
    Feedback
    The Coffee Lounge



Script Downloads
Disable Form Buttons

Featured: July 23, 2008
Description: This script will disable your submit button in order to prevent multiple form submissions. Easy to implement.

Get Script

Hosting Search
Unix   Windows
PHP   Webmail

Sign up for the free WebDeveloper E-mail newsletter!


JupiterWeb Commerce
Partners & Affiliates
Partner With Us
Televisions
Promotional Pens
Online Education
Free Business Cards
Disney World Tickets
KVM over IP
Imprinted Promotions
Laptops
Phone Cards
Prepaid Phone Card
Best Price
Compare Prices
Promotional Items
Online Shopping

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Just because Web sites are easy to build these days, that doesn't mean it's easy to build a quality Web site that meets your business objectives.

Before developing your next Web site, or redesigning an existing site, download this Internet.com eBook to guide you through the process and plan your project, whether you're developing a site in-house or outsourcing the project.
Register now for your free Internet.com membership to download your complimentary eBook. Membership will also give you access to:

eBook library         Whitepapers         Webcasts
Newsletters         WinDrivers

TCL: A CGI Scripting Language

by J.M. Ivler
Reprinted from Web Developer® magazine, Vol. 1 No.1 Winter 1996

What is Tcl and why use it for CGI scripting? Is it better than C? Shell? Perl? Tcl is the Tool Command Language created by Dr. John K. Ousterhout (formerly of The University of California, Berkeley, but now with Sun). The language is a very transportable shell language that has strong extensibility. It is generally used with Tk, a X-based GUI toolkit that makes prototyping graphical applications easy.

In many Usenet newsgroups there are constant flame wars on the usefulness of the language. Is it better than Perl? Is it better than Python? Why use it for one application vs. any other language? Tcl is not the "greatest" language for application building. Tcl is not the be-all and end-all language for application building. If you want a flame on languages, go to Usenet news. There's always a language war going on there.

Tcl is a good language because it is portable and extensible. It can run on platforms as varied as VAXen and Macs, as well as almost all flavors of Unix. It also allows for its library to be extended by the user, either in C or in Tcl. Its simple structure of "command argument argument" and strong string and list processing capabilities make it easy to use to perform complex parsing operations and string manipulation. Additionally, there is the ability to use associative arrays rather than being limited to numerical and multi-dimensional arrays.

Admittedly, there are some of these very same strengths in numerous other languages (LISP comes to mind most often, especially with the {} syntax of Tcl). In no way is Tcl being touted as the best language for scripting CGI code in, but it is an option.

In order to provide for easy extensibility of the forms to e-mail process, Tcl was chosen for its clear and clean style. Any site administrator can add hidden variables within the form, and easily add code to pick them out and provide additional functionality from within the CGI. A good example of that could be seen in the comments on what happened between the initial version and the upgrade printed here. Additionally, you can see the "code fragments" included in the main article. These fragments can be added to the email.tcl program to upgrade from 2.0 to the 2.1 version currently in development.

The code changes to the forms to email application, adding management functionality and limitations, as well as permitting an additional level of user functionality with hidden form variables, were accomplished in about 10 minutes of programming. No recompiles, no changing executables across numerous platforms.

As for Perl, Shell, and C? Yes, they are all great for CGI development. In fact the uncgi program that this code relies on is written in C. Tcl is right for small applications that you want to be able to make changes to, to extend and to contract functionality. And the ability to treat strings as lists and lists as stings provides for an enhanced ability to perform complex string and list manipulation easily.

To obtain a copy of Tcl see the following URL:




Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers