Home | Windows | Linux | Hardware | Shopping | Web Building | Downloads | Tech Support
Webpedia
 

 Front Door
 Animations
 Discussion
 Interviews
 Opinions
 Reports
 Tools
 Tutorials

 Downloads »

 Browse by subject.
Free Weekly Newsletter!

A free service rounding up the week's news, articles, tips and reviews.

text html
Internet News
Internet Stocks
Internet Technology
Web Developer
Internet Marketing
ISP
Downloads
Internet Resources
International

Search internet.com
Advertising Info
Corporate Info
Internet Trade Shows
Print this article
Email this article

  Webpedia / Tutorials



Free Internet Technology info!

Beginners Guide to CGI in Perl
Your First Program!

Nathan Poole

Let's open MS-DOS and type the following

cd C:Perlin.

We do all our Perl work in C:Perlin so we can keep track of our files. Next, type Edit 1.pl which will open MS-DOS's text editor. Type the following on your screen.

#!/usr/bin/perl
print "Hello World!";

Next, save that file and exit (FILE->SAVE -- FILE->EXIT) and type perl 1.pl.

No prizes for guessing what this does. By now you should have the text "Hello World!" on your screen. Not too difficult yet is it?

A little more advanced

Now that we've used your perl path, and we've used your print statement, let's try using a variable ($) with an if statement. Type edit 2.pl at your MS-DOS prompt and type the following in.

#!/usr/bin/perl
$myname = "Nathan Poole";

if ($myname eq "Nathan Poole") {
print "Yes, it's Nathan alright";
}

Go to file, then save, then exit. You should now be back at the DOS prompt. Type perl 2.pl. WOW! It worked! You just made 2 programs in about 10 minutes. Not bad for a beginner. Until next week when I conclude this article with a tutorial on creating your first CGI program, let me know if you had any problems with this tutorial, did everything work out for you? Too easy? Too hard? My mailbox is always open.

« Back: Introduction

Skip Ahead

1 Introduction
2 What can CGI do for me?
3 Perl / perl Tools
4 A Few Lessons
5 Your First Program!

Stock Market Analysis

internet.com home | write us | search | help! | about us

 Copyright © 1999 internet.com Corporation. All Rights Reserved.
About internet.com Corp. | Press Releases
Privacy Policy | Career Opportunities