Jerry Wayne Odom Jr.

PERL VS. PHP



Last week I was surfing Webmaster World and came upon a thread where a member was curious as to which programming language was the most popular Internet duct tape at the time. I use both of these languages almost daily and I can say without question that they are both very useful in their own right. I use each language whenever I'm performing particular tasks and sometimes I have php programs that call perl backends for web based programs.

When is PERL best?

PERL is best used for me when I do some sort of aggressive regular expressions parsing or low level socket programming coupled with multithreading. For example if I have to tear apart thousands of lines of data per second I use perl. If I have a system that has to handle bulk data then I use perl.
PERL is also essential to all my daemons on my unix boxes. Without PERL I'd have alot of maintenance to do all the time and would probably never sleep.

When is PHP best?

Anytime you're working on Internet User interactive software systems php is the animal of choice. PHP allows you to couple programmed functionality into your webpages without the user seeing any of the underlying technology. PHP brings webpages to life in ways that would require massive headaches in perl via very few lines of code. Many times it actually seems too easy. Writing forms, creating a better user experience? use PHP.

Which is easier to use?

PHP is probably easier to use for the beginning programmer. Its rewarding in that basic functions will allow spectacular results in a browser from a programmers point of view. PERL is also a bitch when it comes to installing and updating modules if you're not an administrator type. Sometimes its almost impossible to get the packages you want.
PHP Books and PERL Books are available.

Regardless of which language you decide you want to learn a number of books are available due to their popularity. I suggest you head down to the local book store and take a look at examples of each. You may find examples of what tasks you're trying to accomplish or get some ideas in what direction you want to go.

Jerry W Odom Jr. - October 9, 2005


PERL and PHP links

CPAN - Comprehensive PERL Archive Network. I love this place when I need a module to perform some task.
PHP.net - Has great listings of functions and docs on php. Generally when I need to know about some sort of function I type in "function name php" in a Google search and PHP net comes up with the data I need.

There are alot of good sites out there but believe it or not 70% of my questions are answered at these two sites. I've been doing this for a long time though.