Article Index
10 Easy Ways to Promote Your Website
5 Simple Steps to Accepting Payments
5 Steps to Understanding HTML
5 Ways to Avoid the 1998 Look
6 Reasons Why You Need a Website
7 Ways to Make Your Web Forms Better
A Question of Scroll Bars
Ads Under the Radar Linking to Affiliates
AJAX Should You Believe the Hype
All About Design Principles and Elements
An Introduction to Paint Shop Pro
An Issue of Width the Resolution Problem
Avoiding the Nuts and Bolts Content Management Software
Beware the Stock Photographer Picking Your Pictures
Building a Budget Website
Building Online Communities
Clean Page Structure Headings and Lists
ColdFusion Quicker Scripting at a Price
Column Designs with CSS
Content is King
CSS and the End of Tables
Cut to the Chase How to Make Your Website Load Faster
Designing for Sales
Designing for Search Engines
Dont Be Scared Its Only Code HTML for Beginners
Dreamweaver The Professional Touch
Encryption and Security with SSL
Finding a Good HTML Editor
Focus on the User Task Oriented Websites
Fonts are More Important Than You Think
Free Graphics Alternatives
FrontPage Easy Pages
Hints All the Way
Hiring Professionals 5 Things to Look For
How Databases Work
How the Web Works
How to Get Your Website Talked About on Blogs
How to Install and Configure a Forum
How to Make Visitors Add You to Their Favorites
How to Run Ads Without Driving Visitors Crazy
How to Set Up Your Hosting in 5 Minutes Flat
IIS and ASP Microsofts Server
Image Formats GIF JPEG PNG and More
Its a World Wide Web Going International
JSP Java on Your Server
LAMP The Most Popular Server System Ever
Making Friends and Influencing People the Importance of Links
Making Searches Simple
Offering Free Downloads on Your Website
Opening a Web Shop with E Commerce Software
Perl Cryptic Power
Photoshop a Graphic Designers Dream
PHP Easy Dynamic Websites
Picking a Colour Scheme
Printing and Sending the Two Things Users Want to Do
Putting Multimedia to Good Use
Python and Ruby the Newer Alternatives
Registering a Domain Name
Registering Your Users by Stealth
RSS Really Simple Syndication
Setting Up a Mailing List
Setting up a Test Server on Your Own Computer
Some Places to Go For More Information
Taking HTML Further with Javascript
Taking HTML Further
Taking Your Website Mobile
Text Ads Unobtrusive Advertising
The 5 Principles of Effective Navigation
The Art of the Logo
The Basics of Web Forms
The Basics of Web Servers
The Case Against Flash
The Confusing World of Web Hosting Making Your Decision
The Evils of PDFs
The Importance of Validation
The Many Flavours of HTML
The Smaller the Better Avoiding Graphical Overload
The Top 10 Biggest Web Design Mistakes
The Web Designers Toolbox
The Web is Not Paper
Theres More than One Web Browser
Time for User Testing
Titles and Headlines Its Not a Newspaper
Tracking Your Visitors
Understanding Web Jargon
Uploading Your Website with FTP
Using Flash Sensibly
Using Quizzes and Games to Get Traffic
VBScript Javascript Made Easy
Websites and Weblogs Whats the Difference
What Do You Want Your Website to Do
What You See Isnt Always What You Get
Which Database is Right for You
Why Doing It Yourself is Best
Why Java Will Drive Your Visitors Away
Why Word is Bad for the Web
Why You Should Put Your Content in a Weblog Format
Why You Should Stick to Design Conventions
Working With Templates
Writing for the Web

Perl Cryptic Power

Perl: Cryptic Power.

Perl is, let's face it, a programming language for people who know programming. It's extremely different from PHP: you can't really just pick it up and use it. Perl bears a lot of resemblance to C and Unix shell scripts, if that means anything to you – if it doesn't, you should probably steer clear of Perl. If you're a reasonably experienced programmer who knows C and you're looking to move onto the web, though, Perl will be a great fit for you.

Perl's Values.

To understand Perl, you have to understand why it is the way it is. There are two phrases that sum up the Perl philosophy: the first is "there's more than one way to do it", and the second is "easy things should be easy, and hard things should be possible". It's disputable whether Perl makes easy things easy, but hard things are certainly possible, and there's more than one way to do them. If that's the kind of language you're after, Perl is for you.

Perl is a free language, and is closely tied to the wider open source movement. This means that you will be able to find the source code to lots of useful scripts that have already been written, and take them apart to see how they work. Unfortunately, though, you might find that easier said that done – trying to understand Perl scripts written by other people can be very, very difficult, and that's one of the biggest criticisms of the language.

Why Use Perl?

Perl's strength, though, (as well as its most difficult element) is that most things you'll do with the language will be done using regular expressions (known as regexps for short). This is what gives Perl its powerful abilities to manipulate text, and make it good for complicated web pages.

The trouble with regexps, though, is that they look like complete nonsense to the uninitiated. All the unusual characters on the keyboard have different meanings, like this:

| - Or. For example, me|you matches 'me' or 'you'.

? - Any one character (or no character), so per? matches 'perl', 'perk' or 'per', but not 'perks'.

* - Any number of characters.

( ) - Separate one lot of syntax from another. For example, you could write h(e|a)??o to match both 'hello' and 'halo'.

[ ] - Matches specific characters and ranges of characters. For example, [a-z] means any lowercase letter from a to z, but no capital letters.

There are many, many more: Wikipedia has a good reference at http://en.wikipedia.org/wiki/Regular_expression.

Once you understand them, regexps let you do complicated things to text. One good example use is taking text that isn't HTML, and writing a set of rules to turn it into HTML intelligently. Regexps can also be used to validate data, such as this one that matches a valid email address:

[A-Za-z0-9]+@[A-Za-z0-9]+\.[A-Za-z]{2,4}

Can you see why people say they're complicated? This one means says that an email address must consist of any number of characters between A to Z or 0 to 9, followed by an @, then the same again, followed by a dot, and then 2-4 characters that must be between A and Z, but not a number. Confused? I was writing it. Most people writing regexps write ones that aren't perfect, and need to be improved before they will work every time. If you can practice and master them, though, they give you a lot of power.

Doesn't PHP Have Regexps?

Well, yes, it does now – they were added by people who wanted to make PHP as useful as Perl is. However, PHP's regexps aren't integrated with the language in the same way as Perl's are.

What Else Can Perl Do?

Perl has all the standard features of object-oriented programming languages: classes, functions, variables, and the rest. One area where Perl is unusual, though, is that it has a very large library of user-contributed functions that can be installed as 'modules'. These modules can be downloaded from CPAN (the Comprehensive Perl Archive Network) at www.cpan.org. Whatever it is you want to do, the chances are you'll find a choice of modules there that can do it – there are hundreds of modules for HTML alone, if you take some time to explore.