Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is PERL dying? 3

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
I was looking in the AJAX forum and they have posted a 'popular framework' survey, included in the survey is most popular server side platform, and PERL is last with 6% (here is the link ) - now PHP came top, isn't that built on PERL and the main difference is it is a scrtipting language you place in your HTML code like ASP, Coldfusion etc...

So do you guys beleive PERL is dying, and PHP is taking over? Do you not think PHP breaks the processing->content separation goals?

And should we all be giving up PERL to learn PHP?

I love PERL, but I don't want to have missed the boat if it becomes extinct.

What's your take on this?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Firstly, I wouldn't ever read too much into a single study, particulary on a single function of the language. A broader survey is the monthly TIOBE index, which currently shows Perl in 6th place in popularity.

PHP has certainly replaced Perl as the language for newcomers to the web programming scene to take up. I'll put it like this: there's still plenty of demand for C/C++ programmers, even though the majority of computing courses now seem to teach Java. Perl (with mod_perl) is running a number of pretty large businesses (e.g. Amazon).

PHP does indeed break the separation of content and presentation. It was originally written in Perl, but I don't believe that's been the case for a while now. It's an easy language for newbies to pick up: embed code directly into your HTML, bung it onto a server and off you go: no variable declaration, no compilation, no modules because all the web-stuff is built-in (why people see this as an advantage is beyond me). Plus the Perl documentation isn't really aimed at non-programmers (though it's *extremely* good when you're at the level of understanding it properly). But it really isn't suited to a whole lot of non-web tasks: it does't even support arrays!!

In the sphere of web programming, PHP has indeed become extremely popular and so it wouldn't ever be any *harm* to learn it. Perl does everything *I* want it to do, and since I don't work in a company with pressure from others regarding what tools I should use, I won't be examining PHP in-depth until I really have to.
 
For web-scripting, PHP certainly seems to have overtaken Perl. But for general scripting and programming, Perl is still very much to the forefront, though Python is making a big impression; I don't think PHP even appears on the radar.

One sign of a dying language is that development of the language has stopped or slowed down significantly. That's certainly not the case with Perl; Perl 6 is a forthcoming major rewrite of the language.
 
thanks for the replies,

ishnid - what do you mean PHP can't handle arrays? , what's a record set then in PHP?

I couldn't program if I couldn't use an array.

I think i'll stick with PERL, I love it, i love the way you can just bolt on a module as and when you need it. Its syntax once understood is great to work with, though as you say initially to a non-programer it can look rather daunting, and I still strugle with CPAN & PERLDOCS - lol

I'd like to learn to do my own OO design in it at some point but find myself keep putting it off, for one reason or another.

Tony - is Python windows compatible as PERL is and what can python do PERL can't?




"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
I've never used Python, but I believe it is available for Windows and it does as much as Perl. People seem to prefer it for its OO capabilities and general neatness.
 
PHP uses hashes and likes to pretend they're arrays in situations where arrays are needed. This often works in practice, so you won't always notice. However, here's an illustration of what I mean:
Code:
<?php
   $foo[4] = 4;
   $foo[2] = 2;
   foreach ($foo as $element) {
      echo "[$element]\n";
   }
?>
There's no element 0, 1 or 3. If it really was an array, there should be undefined elements in those positions (as there would be in Perl). In fact, PHP doesn't even print them in the right order: position 4 comes before 2. To get them in order, you have to sort the keys of the hash first with ksort. Needless to say, that's not how real arrays are supposed to work.
 
that looks weird to me ishnid, you've declared them as indexes of the array @foo, but your saying PHP takes the declaration and makes them hashes, not sure i like the sound of this PHP - lol.

How would i make an array of hashes with PHP

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
My PHP knowledge is far from extensive, I'm afraid. That's about as far as I go. From some really quick playing around, this appears to initialise an aray of hashes (in Perl-speak: obviously it's really a hash of hashes in PHP and even then they insist on calling it an array):
Code:
$foo[1]['blah'] = 'blah';
 
I think i'll stick to PERL, took me long enough to grasp it, would seem pointless throwing all that knowledge away!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
To throw something else in here: I like Perl over PHP because I like the idea of having all my programming all in one spot, even if it means doing all the backend work of printing headers and HTML codes.

Even in JavaScript I tend to use external JS files rather than embed it directly within the HTML... embedded code (ie. PHP) is to HTML what ActiveScript is to Flash. If you've ever done programming in Flash, it's pretty difficult because your code is scattered among several different frames and objects.

So that's mainly why I like Perl better. :)
 
I hear ya, I have moved on to using totaly external js files, learning from the X/HTML/CSS forum, they are heavily into lean, semantic, concise X/HTML, nothing but the bare minimun of tags needed to hold nothing but the content of the web page.

So with all this separation and right tool for the job attitude I now use PERL to process, template module to facilitate presentation, X/HTML for content, external CSS file for layout/design and external JS for client side.

OK I still break this rule in the very odd place, but try my hardest to keep it to the bare minimum, unlike my early days of a mish mash of everything in PERL a zillion backslashes and treating CSS like an extra atribute to HTML tags!

So I guess to acheive total separation which is the ultimate goal it is better i don't know PHP, ASP (I've dabled with CF but don't use it) and any of the other embeded type languages.

Though I do use SSI !

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
FYI, embedding code in HTML is only the default option in PHP. It's like claiming Perl sucks because you have to use [tt]print[/tt] statement to output HTML. Yes, the default framework makes it much easier for newcomers, but I think there are more templating libraries for PHP than Perl. And PHP has PEAR, which is kind of like CPAN, but not as extensive.

I know very little about PHP, but I just want to stress the bias opinion you get asking such a question in Perl forums. It's not malicious, most people here just know a lot about Perl, and not so much of PHP. You'll get a much different response if you ask over on their boards.

And I must confess, it's been awhile since I've written any amount of Perl code. Work is in VB.NET and SQL Server these days, though I still find myself thinking in Perl. I can't say how many times the task in perl would have been a simple one-liner, but VB takes ten lines and two functions. That's the beauty of dynamic languages.

I know about as much Python as I do PHP, but have a much warmer spot for it for some reason. As expressive as perl is, the ability to do the same thing in vanilla perl five different ways, python is the opposite. It is a very simple language, whose syntax strives to make code readable. That's definitely on my list as the next language to pick up.

Back to Perl....dying might be a little harsh, but I'm not sure it's expanding its influence at all. Perl 6 has been in development for many years, and I wouldn't be surprised if it took many more. And when that happens, is that really going to help the language take off? I had high hopes for Parrot, but I think it's too late. .NET's CLR seems to have filled the niche for a virtual machine, and things like the mono project have taken that spec to the open source level. IronPython was released not too long ago, which is a complete Python implementation on the CLR.

I don't know, people have been calling the death of Perl for awhile, as has Apple and BSD, but there's always going to be fans that keep each alive. Cobol and Lisp still exist, I gotta believe Perl will outlive both of those.

[/ramble]

- Andrew
Text::Highlight - A language-neutral syntax highlighting module in Perl
also on SourceForge including demo
 
thanks Andrew, appreciate your input.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top