spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / web / programming / perl / 101 / reviews

Review

Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source

Perl 101

To review what we have learned, let’s start again, briefly, at the beginning. We learned how to FTP a program to the server and how to set the appropriate permissions. We learned that the first line of our program needs to point to the location of the Perl interpreter. We learned what a comment is, how to use them, and the correct syntax (Start a line with # followed by your comment). We learned about scalar variables, their syntax, and how to correctly edit them. We learned the difference between server paths and URLs. We learned that a subroutine is a block of code that completes a specific task when called. The correct syntax would be something like this:

&GetDrink # Call Subroutine

sub GetDrink { #The Actual subroutine
print "I am thirsty";
} #End subroutine

Every time we called the subroutine now in our program we would print the line "I am thirsty." We learned about query strings and simple pattern matching in Perl.

if ($something =~ /exec/i) #matches for a non case sensitive regular expression containing the
# letters exec.

if($something_else eq "exec") #matches strictly for the word exec, case sensitive

We learned how to open and close a file using a file handle, and the three ways to modify the file:

open(FILE1,"$FileName"); # Opens as read-only
open(FILE2,">>$FileName"); # Opens for appending
open(FILE3,">$FileName"); # Opens for writing (deleting previous contents)

It would be relatively simple to write a program that would parse our text file and tell us each user’s progression through the Web site. It would also tell us how long they spent on each page and what kind of browser they were using. It would function as a limited statistics package collecting some very useful information. If nothing else, remember that it’s a "Perl-fect" world!

Comments are welcome

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

webref The latest from WebReference.com Browse >
Working with the DOM Stylesheets Collection · Administering RBAC in PHP 5 CMS Framework · xref: Automatic Cross Referencing Script
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Combine BottomCount() with Other MDX Functions to Add Sophistication · Creating a Daemon with Python · The Coming Voice-over-WiMAX Revolution


Revised: May 8, 1998

URL: http://webreference.com/programming/perl/101/review.html