internet.com

Go to WebDeveloper Home


hm-v6-139x61.gif

Database Journal: The Knowledge Center for Database Professionals

find a web host with:
CGI Access
DB Support
NT Servers
UNIX Servers
Telnet Access

advanced search
jobs

Get FREE Development Info via your Email!

The Webdeveloper channel
FlashKit
GIF.com
HiermenusCentral
webdeveloper Jobs
Java Boutique
JavaScript.com
JavaScript Source
ScriptSearch
StreamingMedia World
WDJ
WDVL
WebDeveloper.com
WebReference.com
XMLFiles.com

internet.com
Internet News
Internet Investing
Internet Technology
Windows Internet Tech.
Linux/Open Source
Web Developer
ECommerce/Marketing
ISP Resources
ASP Resources
Wireless Internet
Downloads
Internet Resources
Internet Lists
International
EarthWeb
Career Resources

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

internet.commerce
Be a Commerce Partner










C G I & P E R L
WebDeveloper.com

Beginners Guide to CGI in Perl

By Nathan Poole (npoole@mydesktop.com)

Why learn Perl?

Perl Tools

Perl (Practical Extraction and Report Language) is probably the most widely used programming language for CGI. To start you off learning Perl, I feel obligated to give credit where credit is due. First off, to Larry Wall for creating Perl itself. Secondly, thanks must be given to Randal L. Schwartz and Tom Christiansen (in no particular order!) for writing some of the best Perl documentation ever published.

First off, to program in Perl I suppose it would be a smart idea to download Perl itself. If you're running Windows95/98/NT you run Perl through MS-DOS. First, for Win32 users, click the link below to download Perl for Win32 by ActiveState.

Pw32i316.exe (1,511 KB) (Perl for Win32 Intel/x86 binary)

After you've download the preceding file, extract it on your machine. It creates the directory C:\Perl and that's all there is to it. You've now installed Perl. Now you'll need to reboot your machine.

Discussed is the following, think of it as 4 easy lessons. There are hundreds of Perl commands, we're going to use 4 to begin with, and we're going to make a program with them.

  • Perl Path
  • Printing
  • Defining Variables
  • Comparing with if statements

Perl Path

When a server installs Perl on their machine, it's given a directory to be stored in. Just like your Perl program was installed in C:\Perl, their Perl would most likely go in a directory /usr/bin/perl. You refer to this so your program knows where to find Perl. This obviously is the first thing in your program. Since I'm assuming everyone using this tutorial is on Windows, we don't need to define these when we're using your Windows Perl, but we will just to get you in the habit. At the top of your program you'll want to type:

#!/usr/bin/perl

This is where Perl is usually installed on a server. If you seem to be having problems when we jump into CGI, check the troubleshooting section of this article and there you can find out how to check your perl path.

[ Click here to move to the next part of the article ]

Fast Jump to Anywhere on WebDeveloper.com:


Contact the WebDeveloper.com staff

Last modified: 20

 

Refresh Daily
Join Editor-in-Chief David Fiedler The Editor With No Time and find truth, justice, and a clue or two.


Browse by Category
[ Site Map ]

ActiveX / VBscript
Browsers
CGI / Perl
Database Connectivity
Design / Graphics
E-Commerce
HTML-Advanced: DHTML, CSS
HTML / Site Authoring Tools
Intranet/Groupware
Java
JavaScript
Multimedia: Audio / Video / Streaming Technologies
Opinions
Refresh Daily: Editorial Column
Security
Servers & Server Tools
Site Design / Graphics
Site Management / Marketing / Log File Analysis
Tutorials
VRML / 3D
XML




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.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES