in reply to Re^2: Perl is sinking (TIOBE): all time low for Perl
in thread Perl is sinking (TIOBE): all time low for Perl

For the sake of learning, I recently built a front-web page access a mySQL web page. The backend ETL part was implemented with Perl. PHP was used to query the front-end. The PHP code passed on JSON structures to my jQuery and Javascript with which my web page was built.

Honestly, I did not see any advantage to using PHP. I have read that PHP has a better interface than CGI but I could not really tell.

There were two reasons for selecting PHP. The first is that being new to mySQL, the book "Head First PHP and mySQL" was an excellent tutorial on mySQL and PHP seems to integrate well. PHP seemed very C-like and Perl so picking up the language was not difficult.

Second, with so much talk about PHP, I felt that learning some PHP could only help my resume.

However, the power or PHP does not compare to Perl. And for Web 2.0 web pages, Javascript and libraries like jQuery are far superior than depending on PHP.

Comparing PHP to Perl, I can state the following: 1. The raw parsing power of Perl is unmatched. 2. The lack of an equivalent STRICT for variable declarations results in numerous debugging headaches. How can one build a robust application without having a strongly typed language? 3. Perl's variable declarations prefixes are so nice as they allow you to spot a scalar from an array from a hash. 4. Hashes are more straightforward. 5. Pointers/References ... No serious programming can be done without pointers, and PHP's roundabout use of pointers is not friendly.

Of course, I am still learning about PHP and it does have a huge libary of functions. But the CPAN library is still unmatched.

Now my backend for the mySQL database was done in Perl Almighty. There was a total of some 4200 NCL lines of code encompassing some 25 modules. The 25 modules were built into a single executable using ActiveState. My application FTP's into some 15 sites collecting information continuously. And Perl does a great job at FTPing! What a breeze to drop my application on multiple machines with none having Perl installed on them.

The Perl DBI is first class. PHP seems to have copied the Perl DBI.

I used caller() for my first time to help point out exactly where errors occured. My error_log_file - thanks to caller() - has been of such enormous help.

My standalone tools in Perl have put many an engineer in shock and awe after seeing how Perl tools have shaved hundreds and hundreds of hours of manual labor from their work. Quite a few engineers around me have purchased Perl books after witnessing the speed with which I relieved them of their headaces. Of course, many give up quickly because without a strong software foundation, you can only do so much.

It would been a nightmare to replicate this effort with PHP.

After working for some 10 years with Perl, I still have to see a language that can match Perl's power. I have looked at Python briefly and did not like it. TCL is archaic. In the past 5 years, I have written over 60,000 lines of NCL code with it. Perl 5.10 has really made this language better. Having a SWITCH statement with SMART_MATCHING is great. But hash references are probably the most powerful thing in this language after regular expressions.

Perl is an easy language to start with but takes time, patience, and opportunities to grow with it. Each new problem that I solve enlightens me more. PHP has grown because for Web Programmers, they can easily embed HTML and PHP. But with AJAX making waves, you are better off using Javascript and Javascript libraries for your HTML.

Even if TIOBE is right as to number of users, that does not make Perl a second class language.

Replies are listed 'Best First'.
Re: Perl is the Almighty
by Lawliet (Curate) on May 03, 2009 at 04:22 UTC
    PHP has grown because for Web Programmers, they can easily embed HTML and PHP.


    (On an unrelated note, could you break up the huge wall of text that is your post? It hurts my eyes to read. Maybe put in a few paragraph tags and an ordered list :P)

    I don't mind occasionally having to reinvent a wheel; I don't even mind using someone's reinvented wheel occasionally. But it helps a lot if it is symmetric, contains no fewer than ten sides, and has the axle centered. I do tire of trapezoidal wheels with offset axles. --Joseph Newcomer

Re: Perl is the Almighty
by Anonymous Monk on Mar 04, 2011 at 17:19 UTC
    hey that's the same language I use. Looks like I wrote this comment...haha and I too wrote ETL code. wow. I love u for ur comment. cheers, siva