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 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.
Information supplied and written by Lee Asher of
Found an error or have a suggestion? Let us know and we'll review it.
Suggest a Correction
Perl: Cryptic Power
1 views
Comments (0)
Please sign in to leave a comment.





No comments yet. Be the first to comment!