×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Perl's Glory Days Are Behind It, But It Isn't Going Anywhere

Unknown Lamer posted about a year ago | from the duct-tape-joke dept.

Perl 379

snydeq writes "Deep End's Paul Venezia waxes philosophical about Perl stagnancy in IT. 'A massive number of tools and projects still make the most out of the language. But it's hard to see Perl regaining its former glory without a dramatic turnaround in the near term. As more time goes by, Perl will likely continue to decline in popularity and cement its growing status as a somewhat arcane and archaic language, especially as compared to newer, more lithe options. Perhaps that's OK. Perl has been an instrumental part of the innovation and technological advancements of the last two decades, and it's served as a catalyst for a significant number of other languages that have contributed heavily to the programming world in general.'"

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

379 comments

Perl's gory days are behind (-1, Flamebait)

Anonymous Coward | about a year ago | (#42723921)

Perl's gory days are behind. That I read first before I noticed I had misread.

Wait, what? (5, Insightful)

girlintraining (1395911) | about a year ago | (#42723925)

So let me get this straight: A programming language that found a niche, became massively popular, and is now widely used... is a failure in your eyes because it's not in a constant state of change?

You're kidding, right? The epitome of a successful programming language is that it has become flexible enough to meet the needs of its users without requiring more than maintenance fixes. This is like saying "grep is useless because nobody's completely redesigned in in the last few months!" Dude, stop drinking the Web 2.0 kool-aid. There are things in the computer world that aren't meant to change every day. I know it's hard to imagine when every pundit is screaming "release early, release often" from every rooftop, but speaking from experience... If you go mangling your programming language every few months like (cough, .NET) some companies do, you're going to find your developers bailing out like rats from a sinking ship.

Re:Wait, what? (0)

EzInKy (115248) | about a year ago | (#42723951)

Sorry man, but PERL is just too damn scary. Perhaps a few mandatory rules could fix this problem? Doubt it though because it seems PERL programmers seem to value code over hardware..

Re:Wait, what? (5, Interesting)

girlintraining (1395911) | about a year ago | (#42723987)

Perhaps a few mandatory rules could fix this problem? Doubt it though because it seems PERL programmers seem to value code over hardware..

You're blaming poor programming on the language. Perl isn't meant to be a replacement for, say, C, but considering its an interpreted language, running at 1/56th speed of compiled code is not bad [modperlbook.org] . The author here mentions PHP, Ruby, and Python. A separate analysis [famzah.net] reveals that PHP is worse. The others are only marginally better because they have a specific function by that particular benchmark test optimized. A separate and equally simple benchmark has Perl on top [phpprogrammer.co.nz] . I'm sure many will be able to come up with more comprehensive benchmarks, and then a flamewar will erupt... But my point (soon to be lost forever in the ensuing tsunami of replies) is that the usage scenario determines language performance, and in many usage scenarios, Perl is the winner amongst the author's picks. Don't blame the language because the programmer either (a) uses it incorrectly or (b) uses it for something other than it was designed for. Perl is fundamentally about string manipulation and I/O between various datasets and is a high-level language. If you aren't using it for that, you're doing it wrong. Not to say it won't work... but it's not the Right Thing.

Re:Wait, what? (1)

Anonymous Coward | about a year ago | (#42724119)

considering its an interpreted language, running at 1/56th speed of compiled code is not bad

What? 1/56 means Perl runs as fast on a 2GHz system as compiled code on a 35MHz system. And that's "not bad"?

Re:Wait, what? (4, Insightful)

ThePhilips (752041) | about a year ago | (#42724233)

That is excellent. Considering that that particular benchmark is arithmetical and Perl has nearly zero optimizations for the arithmetic.

Re:Wait, what? (5, Informative)

spxZA (996757) | about a year ago | (#42724639)

In my third year of varsity, we had to write a search engine with indexing stored in files. My Perl solution returned results twice as fast (averaging 22ms/query) as any other in the class, most of which were C or C++. And it took me half the time to write.
I love Perl mainly because of I am a lazy programmer. Yes, most of my Perl scripts take a little bit longer to execute, but we're talking a difference of seconds or minutes, not hours. There are times where I choose Perl, Python, C/C++, PHP, etc, but this depends entirely on the problem and the circumstances. I will use Perl until I die, even if there aren't any more releases from now on.
Should we lament Bash for the same reasons? The last release (4.2) was 13 Feb 2011, and the last feature release (4.0) in early 2010. ZOMG!

Re:Wait, what? (3, Insightful)

dargaud (518470) | about a year ago | (#42723999)

Yeah, perl got popular for several reason, such as its ease of string manipulation. But it soon turned into 'use regex for everything'. At the time no other languages (except for sed, but calling it a language stretches it a bit) had easy regex, but that's no longer true. And its extreme compactness is also a hindrance as it turns any reasonably optimized code into symbol soup.

I also find this TMTOWTDI (There's more than one way to do it) philosophy frustrating. I did Perl for a year, wrote clear but slow progs, went to usenet for advice, got a first prog half as long and twice as fast, then a second... and at the end of the line a great one-liner that was plain impossible to understand.

Re:Wait, what? (0, Funny)

Anonymous Coward | about a year ago | (#42724033)

I also find this TMTOWTDI (There's more than one way to do it) philosophy frustrating. I did Perl for a year, wrote clear but slow progs, went to usenet for advice, got a first prog half as long and twice as fast, then a second... and at the end of the line a great one-liner that was plain impossible to understand.

You are not supposed to understand the code. You are supposed to hail the awesome programmer who wrote it. :-)

Re:Wait, what? (4, Informative)

Anonymous Coward | about a year ago | (#42724179)

I'd still say they don't have an easy regex.

Perl's is an actual operator in the language, all other languages require you to build and use a regex object... which means 1 line in perl requires more lines (define+create, then test) in others to do the same.

TMTOWTDI (There's more than one way to do it), (1, Insightful)

MrKaos (858439) | about a year ago | (#42724587)

just usually not with perl...

...the opinion I got from many management types were Perl was just a little too clever. Personally though, I find the challenge of crafting regular expressions interesting puzzles to solve, just like a more geeky crosswords. I'm better at sed and awk than with all that Perl has to offer but I found a similar scenarios. Even though the solutions look succinct, neat and, apparent to you the problems worth solving to the limit of your understanding could not be maintained by people without it. Unfortunately few people want to put the mental effort into gaining the understanding, which is what the problem is for Perl.

I like Perl, I'm just not very good at its subtilties yet, but when I get there I'll probably be another fan like many are. Perl's glory days aren't behind it, it just takes a lot longer to appreciate what Perl offers.

Re:Wait, what? (1)

Anonymous Coward | about a year ago | (#42724047)

Sorry man, but PERL is just too damn scary.

That must be the reason why most people use Perl instead. :-)

Re:Wait, what? (0)

Sique (173459) | about a year ago | (#42724065)

They don't use the Practical Extract and Report Language (PERL) anymore? (If you ever wondered what perl stands for.)

Re:Wait, what? (3, Informative)

stjobe (78285) | about a year ago | (#42724517)

From perlfaq1 [perl.org] :

What's the difference between "perl" and "Perl"?
"Perl" is the name of the language. Only the "P" is capitalized. The name of the interpreter (the program which runs the Perl script) is "perl" with a lowercase "p".
You may or may not choose to follow this usage. But never write "PERL", because perl is not an acronym.

From wikipedia [wikipedia.org] :

Though Perl is not officially an acronym, there are various backronyms in use, such as: Practical Extraction and Reporting Language.

From Learning Perl, 2nd Ed:

Perl is short for "Practical Extraction and Report Language," although it has also been called a "Pathologically Eclectic Rubbish Lister." There's no point in arguing which one is more correct, because both are endorsed by Larry Wall

Either way, typing the name of the language in all-caps is wrong.

Re:Wait, what? (5, Insightful)

solidraven (1633185) | about a year ago | (#42724073)

No, you look at Perl in the wrong way! The camel is good at what it's designed for. It won't do it neatly but it'll get the job done. Need to hack two incompatible systems together quickly? Perl is there for you. Need low level access from a scripting language? Perl fills the gap. And in terms of performance the old camel still gives a lot of new "optimized" languages a run for their money. It's also one of the most flexible languages out there. Name a few other scripting languages that are used on such a wide range of systems? You'll encounter Perl on the small embedded systems and on large clusters. It simply adapts to the task at hand. It's sort of like Fortran and Ada in that, many people are against it but those who are familiar with it know what it's capable off aren't going to drop it cause it looks ugly to the younger programmers.

In case you're wondering Fortran is the best data crunching language out there and Ada is in a league of its own when it comes to reliability. Idealism doesn't have a place in engineering, you use the right tool for the job and stop whining about how easy it is to use or master.

Re:Wait, what? (3, Interesting)

rgbatduke (1231380) | about a year ago | (#42724317)

And C is the best to write operating systems (and a lot of other stuff) in and APL is actually pretty nifty for writing certain kinds of vector code and...

Personally, I still love Perl and use it by preference when I need a short one-off program that doesn't have to be fast, especially one that does a lot of parsing. It is a great on-the-fly translator, and is often used to facilitate data conversion of one sort or another because it is so easy to use for that purpose. I have written far more complicated stuff -- actual interactive GUI applications -- in Perl, but that's where one is probably pushing it outside of its area of primary utility and I probably won't do that again. And yeah, one of the best features of Perl is its ability to split lines and do regex processing in a syntactically compact way. Tools like awk/sed/bash are also very useful for doing simple stuff -- pattern matches and substitutions -- but sed rapidly becomes arcane to the point where one has to keep a library of sed 1 liners or examples handy to remember how to pull the third octet out of an IP address, add 24 to it, and write it back or the like. In Perl doing this takes several lines of code (if you want the result to be readable) but it is easy and robust to code and understand. I used to use awk a lot (15-20 years ago), but Perl completely superceded that. I do still use sed simply because s/aaa/bbb/g is so damn useful on the fly, more so if you chain several sed conversions and other stuff together in a pipe. But once the complexity passes a fairly low threshold, Perl is very much a tool of choice.

Of course it is not unique. Nowadays, lots of people like other similar languages e.g. python that serve more or less the same space. But arguing about which of the available languages is "best" is a fruitless exercise. Philosophically they are very different. Some people like what I would call "fascist" languages (where python is in that category IMO) with strict rules on e.g. indentation and structure. Some people like loose, free languages that don't care how you indent and use brackets instead. Some people like procedural languages. Some people like object oriented languages. Some people are agnostic and like languages that do both, each in its place. And whatever the programmer likes, there is also the task -- some tasks manipulate data or perform computations in procedural ways, some work with data objects.

Personally, I think any rumor of the demise of Perl is likely exaggerated and premature (and I'd want data to support it!) I use it all the time, and obviously I wasn't surveyed. A lot of the rise and fall of scripting languages is dictated by what schools are teaching and what people need in jobs, and these days it is dominantly java (or javascript), python (because it is easy to teach structured programming in python), php (because it enables web programming), and even "html" (which isn't really a programming language but so what). For web programming -- a major if not the major marketplace for programmers -- and even for database programming (web interface to database) this set makes sense. Perl was popular early on for writing web scripts because it worked, but it wasn't really designed for that purpose and languages that were (but were otherwise remarkably perl-like) eventually won out. So what? That wasn't what Perl was written for, and it's not what it does best.

rgb

Re:Wait, what? (2)

smpoole7 (1467717) | about a year ago | (#42724649)

> actual interactive GUI applications

Or games. :)

http://en.wikipedia.org/wiki/Frozen_Bubble [wikipedia.org]

One of my favorite games was written in Perl, using the SDL for the graphics.

Whether it was the "best" choice or not is for another debate. But you're right, if you want to think outside the box, Perl will go there, too. :)

Re:Wait, what? (4, Insightful)

LordLucless (582312) | about a year ago | (#42723953)

So let me get this straight: A programming language that found a niche, became massively popular, and is now widely used... is a failure in your eyes because it's not in a constant state of change?

Uh, no, that'd be you putting words into the writer's mouth. How about this:

As more time goes by, Perl will likely continue to decline in popularity and cement its growing status as a somewhat arcane and archaic language, especially as compared to newer, more lithe options.

It's not failing because it's not changing, it's failing because less people are using it. The lack of it integrating shiny new features may be one of the factors contributing to this.

Re:Wait, what? (2)

dkf (304284) | about a year ago | (#42723985)

[Perl is] not failing because it's not changing, it's failing because less people are using it. The lack of it integrating shiny new features may be one of the factors contributing to this.

Maybe, but probably not. It's probably more closely linked with the culture of dodgy human-readability and the changing profile of what people want to do with programming languages. On the first point, the issue isn't that it is impossible to write readable perl — that's emphatically not true — but rather that most perl programmers don't do that; it's a culture thing. The second point is much more to do with perl not being universally present in browsers, or numpy, or rails: some niches where perl wasn't the leader have turned out to be really important (and that's not to deny perl's success in others).

You can't win them all, and the only constant is change.

Re:Wait, what? (5, Interesting)

girlintraining (1395911) | about a year ago | (#42724031)

It's not failing because it's not changing, it's failing because less people are using it.

Compared to the alternatives the author suggests? Ruby and Python combined are doing less than Perl. PHP is the runaway favorite [w3techs.com] , but if you dig into the numbers, you'll find that most of the change is due to Content Management Systems which by and far have been developed on PHP. So these massive zomfg numbers PHP is pulling in isn't due to people programming with it as much as they are copy-pasting it en masse.

Perl is often custom back-end stuff with little visibility. It runs in cron jobs. It happily links various back-end pieces to one another... doing its unglamorous jobs with ease. Yes, Ruby is pretty and shiny. Yes, Python is a hot thing right now. But I've developed for all of them, and you know what? Perl is still what I'd turn to for back-end work over either of them because it's easy to work with and in many use scenarios I encounter professionally... faster as well. Python starts to choke (badly) in a take-down-the-server kind of way when it gets taxed. Ruby is the same way. But Perl seems bulletproof... even in a resource-constrained environment, it just. doesn't. die.

And for me, writing code for corporate use... Reliability trumps shiny any day of the week.

Re:Wait, what? (1)

LordLucless (582312) | about a year ago | (#42724105)

Compared to the alternatives the author suggests? Ruby and Python combined are doing less than Perl. PHP is the runaway favorite [w3techs.com], but if you dig into the numbers, you'll find that most of the change is due to Content Management Systems which by and far have been developed on PHP. So these massive zomfg numbers PHP is pulling in isn't due to people programming with it as much as they are copy-pasting it en masse.

In the article, the author posits that PHP/Python/Ruby are nibbling away at Perl on the web front, and that bash is, for some reason, eating Perl's lunch in the sysadmin/code-glue areas. Besides, the article author is looking at the TIOBE index. TIOBE is based on search hits regarding a particular language, not looking at web-facing systems. That methodology has its own flaws, but it shouldn't be skewed towards public-facing websites or people passively using a CMS like your link is - and TIOBE lists PHP and Python as above Perl, and Ruby not far behind.

Perl's a mess (1)

fyngyrz (762201) | about a year ago | (#42724495)

On the one hand, with Perl, you can't even create and use a multi dimensional array without barely comprehensible hacks. On the other, the language itself leans too sharply towards gibberish instead of natural language. But it's powerful, and mostly (excepting a few outliers like multi-dim arrays) complete.

I speculate that the only reason that it's as popular as it is, is because people stick with what they know, especially if what they know is complex, functional, and esoteric doesn't hurt either -- it's rather like a form of job security. And a lot of people know Perl.

For myself, I learned Perl first, but was still interested in languages, and so continued with Python, PHP, Java, and so on. For a scripting language, I settled with Python, and feel that it is far superior to Perl in just about every way imaginable (and yeah, I'm a fan of the indentation, too, though I can see that if that's not similar to how you formatted your code in the first place, you'd not be likely to appreciate it. Me, I come from a C background where indentation far more formal than the K&R style was required.)

Anyway, if you're not a language bug, it may well be that one (or two) languages is quite enough. I don't expect long term Perl users to be looking to change, and that's why, I suspect, Perl is still so popular.

Re:Perl's a mess (3, Informative)

vlm (69642) | about a year ago | (#42724617)

On the one hand, with Perl, you can't even create and use a multi dimensional array without barely comprehensible hacks.

Unimpressed.

http://perldoc.perl.org/perldsc.html#ARRAYS-OF-ARRAYS [perl.org]

$AoA[0][0] = "Fred";

print $AoA[0][0];

I will give you that iteration syntax over a AoA can look a little weird to the uninitiated.

I pretty much stopped using multidimensional arrays as a complex data structure when I learned OO except for the obvious mathematical applications. Although for hard core math I tend to take advantage of octave. I've used Inline::Octave from cpan but thats kinda weird.

I wouldn't do massive scale text processing in Octave unless I had a really good reason, much as I wouldn't do massive math work in Perl unless I had a really good reason.

The easiest "hack" on AoA is not to use them, if the application is simple enough. If you just need a crude data store just make a simple hash. So instead of [2][3][4] as a 3-dimensional coordinate, just store "2 3 4" as a hash key.

Re:Perl's a mess (1)

Anonymous Coward | about a year ago | (#42724739)

"with Perl, you can't even create and use a multi dimensional array without barely comprehensible hacks"
Why are you talking about a language you don't know ?
Once again, 90% of people that criticize Perl don't actually know it.

Re:Wait, what? (1)

vlm (69642) | about a year ago | (#42724565)

TIOBE is based on search hits regarding a particular language,

Massive inherent bias toward the new. "Perl? What is that? Is it new? Maybe I should google for it." Seriously?

Re:Wait, what? (1)

smpoole7 (1467717) | about a year ago | (#42724733)

> TIOBE is based on search hits regarding a particular language ... that methodology has its own flaws

To put it mildly. Thanks for saving me the time and trouble of reading a useless article.

Case in point: I just did a search on Ada after reading some of the comments here. That will, no doubt, help make it a tiny bit more "popular" to this guy's methodology. But I have absolutely no desire to learn that language or to program in it. I'll stick with my trusty ol' C/C++.

Re:Wait, what? (1)

guacamole (24270) | about a year ago | (#42724737)

Indeed. It's not clear to me why bash would suddenly become that important. Please. Did I miss something?

Re:Wait, what? (1)

Sique (173459) | about a year ago | (#42724115)

That's exactly what I use Perl for. Turning Excels whose data has to be sanitized first into lists fed into other programs. Creating batches of config files on the fly that are quite similar to each other and differ only on some parameters which I read from a list. Converting config files from one product into config files for another, which will replace the first one etc.pp.
Backend stuff that will be never seen by a user or a customer anyway.

Re:Wait, what? (0)

Anonymous Coward | about a year ago | (#42724235)

Hardware is cheap, developer time is not. Especially not for developers who are smart enough to understand all the automatically obfuscated Perl gibberish that the last guy vomited all over the systems.

Re:Wait, what? (1)

benjfowler (239527) | about a year ago | (#42724265)

My shotshot coder kid cousin, cutely described Python as a 'legacy language'.

I should've asked her what she considered NOT legacy, especially since Python uptake, afaict, is actually increasing.

Re:Wait, what? (0)

Anonymous Coward | about a year ago | (#42724321)

absolutely, and it still has the best regex handler. And nothing is more fun than trying to describe what all the symbols in a regex do

Re:Wait, what? (2, Interesting)

cmdr_tofu (826352) | about a year ago | (#42724573)

First off, I love Perl, but I hate it too. All of my backend code used to be Perl, but I long since abandoned it for Ruby. Now when I have to use Perl, it's usually called from a Ruby script and I real the Perl output into Ruby through JSON.

As far as performance is concerned, i think Python is really a top contender with native thread support, but generally for sysadmin stuff, you don't always need a high-performance solution. For something that is easy-to-write, and easy-to-manage, and almost more importantly easy-to-read-the-code-2-months-later, Ruby is great. I have nothing bad to say about Perl, but there are clearly some advantages (when using objects especially) to Ruby and Python. The Perl community (perlmonks.org) is the best programming community I've ever come across. The only reason I even switched to Ruby was because I believed that Parrot would bring a convergence and interoperabilty between Perl 6, Ruby and Python.

If Perl becomes less relevant in the future it would make me sad.

Re:Wait, what? (2)

guacamole (24270) | about a year ago | (#42724585)

I am trying to remember where I read this, but I think I indeed heard somewhere that Python's solution under certain out of memory conditions is simply to die and exit. But still, I wouldn't discount Python as a fragile programming language. One good testament to Python's reliability is the fact that much of mailing list servers are now running GNU Mailman. GNU Mailman was what put Python on the map for me. Before Mailman, I thought no one in their right mind would write mailing list software in anything other than Perl. I was wrong.

Perl will probably linger as the language for unix scripting tasks for a long time. After all, this is how it got started. And then there is the huge library of code at CPAN that's extremely important on its own. I do think that Python is a better general purpose programming language. It's now used for a very wide range of tasks, from teaching computer science algorithms to numerical number crunching with scipy. Perl never quite got a lot of traction in such areas.

Not for long: Python convert here. (0)

Anonymous Coward | about a year ago | (#42724607)

Ruby and Python combined are doing less than Perl.

Whenever I write something new these days, I make a bee line to Python (outside of systems type of stuff). Python offers everything I could possibly want. If there's something missing, I just break out the 'C' compiler and design something.

I divorced Perl for a younger, thinner, prettier and smarter language.

Perl has gotten fat, old, and ugly.

Re:Wait, what? (3, Insightful)

tlambert (566799) | about a year ago | (#42724037)

As more time goes by, Perl will likely continue to decline in popularity and cement its growing status as a somewhat arcane and archaic language, especially as compared to newer, more lithe options.

It's not failing because it's not changing, it's failing because less people are using it. The lack of it integrating shiny new features may be one of the factors contributing to this.

I agree that that's what the article author is saying; he specifically cites release timeliness and "forward progress", which he goes on to define as additional features.

I think this is in error. Perl is less maintainable than other languages, due to the myriad of "correct" was to implement solutions to various problems, and once the challenger language in question has evolved to the point that it can map a sufficient portion of the problem space mappable by perl, it was inevitable that it be displaced. As the article author states, it's not going anywhere, but, like COBOL, you aren't going to be seeing significant new code bases written in the language.

Python, I think, owes its popularity in no small part to being an official language in places like Facebook and Google; perl is specifically prohibited in all cases in both companies. If one language is used by a company where it's desirable to work, and another is prohibited, which language are you going to learn?

PS: I think the best place to look for perl's health, or lack thereof, is the coverage for systems interface changes in CPAN. If perl get coverage for significant new APIs, but not other APIs, then it's still alive; otherwise, it's on its way to legacy code and/or deprecation. For example, if there's support for membuf, ioevent, and similar interfaces, I'd say perl was far from dead.

Re:Wait, what? (2)

Viol8 (599362) | about a year ago | (#42724089)

"The lack of it integrating shiny new features may be one of the factors contributing to this."

Nah , IMO its because people only used Perl because there was no alternative for problems that required a scripted solution that couldn't be done with shell or awk and where C/C++ would be overkill. Now we have Python which is what most people would consider a "proper" language rather than the rather messy line noise that is Perl.

Re:Wait, what? (0)

Anonymous Coward | about a year ago | (#42724249)

Python can be just as messy as Perl at times, especially with all that bloody whitespace.

I think Perl's biggest problem is it's liberal use of $ % @ etc operators in variable names. I like them. They're there for good, cool reasons; but it means when someone reads Perl code the first time they all stand out that half the characters look weird and their brain goes 'argh'. And that means their first impression pushes them away.

Perl code can be extremely readable (mine is), how you use it is up to the author. But a lot of people almost take a perverse pleasure in making programs as compact and unreadable as possible while still being correct, and that too pushes people away because they come to believe that's how the language is rather than those programs.

Re:Wait, what? (4, Insightful)

Tridus (79566) | about a year ago | (#42724297)

That "bloody whitespace" is one of the reasons your average python code is more readable than your average perl code. You don't see a lot of python code that should actually be 30 lines but is crammed into one because the developer though that line breaks are some kind of precious resource.

Re:Wait, what? (1)

LordLucless (582312) | about a year ago | (#42724695)

It's also the reason python devs aren't allowed to have nice things - like multi-line lambdas.

I use python professionally every day. I like lots of things about it. But it does seem like it can't have any new features until Guido's figured out some way to implement them differently than anyone else.

Re:Wait, what? (3, Interesting)

Viol8 (599362) | about a year ago | (#42724363)

"I think Perl's biggest problem is it's liberal use of $ % @ etc operators in variable names. I like them. They're there for good, cool reasons;"

No they're not. There is no good reason for having to tell the interpreter the type of the variable once its been created. It should already know. Its just pointless noise that doesn't need to be there and reduces readability. The reason shell script does it is because it needs to know if its a variable or program name, perl doesn't have that restriction.

Re:Wait, what? (4, Insightful)

arielCo (995647) | about a year ago | (#42724581)

$foo is one (scalar) variable, which is not the same as @foo (array), and %foo (hash) and foo (file handle), which can coexist without interference, and no Perl programmer will be confused by that (we actually think of the sigil as *part* of the name, as in "dollar foo" and "percent foo"). So it's not redundant syntax, which Perl avoids like the plague.

They're also there to ensure that you're getting the right kind of value when you build an expression, like @stooges = @people{('curly','larry','moe')} (stooges is an array, people is a hash). That is the kind of compact syntax that makes it popular as opposed to iterating over the keys to add the values to the array.

Re:Wait, what? (2)

mooingyak (720677) | about a year ago | (#42724697)

$foo is one (scalar) variable, which is not the same as @foo (array), and %foo (hash) and foo (file handle), which can coexist without interference, and no Perl programmer will be confused by that (we actually think of the sigil as *part* of the name, as in "dollar foo" and "percent foo"). So it's not redundant syntax, which Perl avoids like the plague.

They're also there to ensure that you're getting the right kind of value when you build an expression, like @stooges = @people{('curly','larry','moe')} (stooges is an array, people is a hash). That is the kind of compact syntax that makes it popular as opposed to iterating over the keys to add the values to the array.

So you're saying that you can have @foo and %foo, and then assign @foo = @foo{('curly','larry','moe')}, and the lhs @foo refers to something different than the rhs @foo? And that's not confusing?

Re:Wait, what? (2, Insightful)

jellomizer (103300) | about a year ago | (#42723971)

Perl popularity is due to its text file processing ability. Back durring it's high points relational databases were expensive and resource hogs. However with faster systems and lower cost or free databases available, Perl need has declined.
Your sites data is no longer being processes in a large text file but in a database. (Granted the database may internally doing the same thing)
It isn't that Perl is bad but it just isn't as useful anymore.

Re:Wait, what? (0)

Anonymous Coward | about a year ago | (#42724003)

I'm willing to bet that very many databases out there have at least some of their data/reports processed with the help of perl. Whether officially or not... ;)

That said nowadays there may be more people "processing" DBs with Excel... Sometimes it's just easier to get an Excel friendly dump of a DB report and let the users decide how they want to mangle it with Excel.

Re:Wait, what? (3, Interesting)

girlintraining (1395911) | about a year ago | (#42724049)

However with faster systems and lower cost or free databases available, Perl need has declined.

I don't think that's what's driving the numbers down; It's the Web 2.0 culture. There are a lot of self-contained solutions (such as content management systems) built on PHP, etc., that pretty much you unpack into a directory, set the permissions and tweak a config file, and you have a usable app. Perl was never about that. Perl is like duct tape -- you use it to glue things together.

Re:Wait, what? (0)

Anonymous Coward | about a year ago | (#42723975)

How many new programs are written in Perl? How many people learn Perl? And how many of those learn it out of interest for the language (as opposed to just due to having to maintain some old Perl program)?

Captcha: perish

Re:Wait, what? (1)

gigaherz (2653757) | about a year ago | (#42724015)

I have to disagree with the bit suggesting that .NET is mangled every few months.

First of all, .NET isn't a language. I suppose you may mean C#, although maybe you have had to mess with VB.NET (which is a torture I wouldn't wish on anyone, but still doesn't apply to what you are saying). So assuming C#, any code written for .NET 2.0 works in the latest version of the compiler, and MOST of the .net 1.0/1.1 should work too.

If you find a piece of .net 1.1 code that doesn't compile in a recent version of the .net Framework, then chances are it's because of the CLR (class library), which in it's original version it still had some maturing to do. But the CLR has been backwards compatible since version 2.0, and Microsoft has only been extending it since then.

Re:Wait, what? (1)

Richard_at_work (517087) | about a year ago | (#42724135)

Not only that, but with most of the features released, you can compile them so they run on a lower installed version so long as it targets the same runtime, so pretty much everything that came with .Net 3.0 and 3.5 can be compiled so as to run on a .Net 2.0 base install, mainly because most of it is syntactic sugar rather than fundamental changes.

Re:Wait, what? (2)

e**(i pi)-1 (462311) | about a year ago | (#42724053)

Second that. Perl is great exactly because it is stable, reliable and because of the prospect that it will remain so. Like the Unix shell, Latex or plain old C. Its maybe as close as one can get to mathematical tools, which by default never change. A language has to earn the status of being archane. Thats when it can be used also within larger projects without worry that basic functionality is depreciated. Its not an exclusive or. The world needs both, new languages which are exciting but change often and old languages which have a track record of being robust.

Re:Wait, what? (1)

TheLink (130905) | about a year ago | (#42724079)

It'll be nice if there could be a JIT or some other accelerator for Perl. Lots of smart people have managed to make Javascript rather fast in many cases, so I wonder if it's possible to do the same for Perl - after all Facebook has accelerated PHP...

There's some work in this area being done for Python but progress isn't as fast as I'd like.

FWIW at a previous workplace I wrote a dhcp server in perl and performance was not an issue (would be nice if it was faster though ;) ). They might still be using it at various sites today. Probably more secure than ISC's dhcpd, plus handled thousands of VLAN interfaces better than ISC's version at that time. DB backed, rules based etc.

Re:Wait, what? (2)

ThePhilips (752041) | about a year ago | (#42724475)

It'll be nice if there could be a JIT or some other accelerator for Perl.

I have seen some old posts about attempts to port Perl's interpreter to LLVM to be able to take advantage of its JIT facility. As far as I can tell, it didn't went too far. (The most discussion I can find. [perlmonks.org] But about work from 2008-'09.)

Main obstacle for Perl's advancement and progress is the Perl6.

You can't change the Perl5 because a lot of stuff depends on it.

You can't make new version of Perl out of Perl5 because Perl6 is already out there.

All in all, I strongly believe that it is the miserable failure of Perl6 what's killing any potential progress the Perl could have made.

Right now, the best thing which could happen to Perl IMO is a fork of the Perl5. Yet, since user/developer base is declining, I very much doubt that would happen.

Re:Wait, what? (1)

cgaertner (1004238) | about a year ago | (#42724681)

Main obstacle for Perl's advancement and progress is the Perl6.

That's a pretty bold claim

You can't change the Perl5 because a lot of stuff depends on it.
You can't make new version of Perl out of Perl5 because Perl6 is already out there.

And you can't make an object-oriented successor to C because there's already C++, right? Look at Objective-C, D, Vala, just to name the more popular ones: Language evolution is not linear. Also, ECMAScript 4.

All in all, I strongly believe that it is the miserable failure of Perl6 what's killing any potential progress the Perl could have made.
Right now, the best thing which could happen to Perl IMO is a fork of the Perl5. Yet, since user/developer base is declining, I very much doubt that would haphttp://developers.slashdot.org/comments.pl?sid=3415413&cid=42724475#pen.

There are two efforts under way right now to do just that.

Re:Wait, what? (-1)

Anonymous Coward | about a year ago | (#42724163)

I want to fuck your butthole. May I?

Re:Wait, what? (-1)

Anonymous Coward | about a year ago | (#42724237)

If you go mangling your programming language every few months like (cough, .NET) some companies do.

Really? You are so full of shit.

Re:Wait, what? (1)

CAIMLAS (41445) | about a year ago | (#42724325)

I agree with you.

OP says things which make me think they'd argue that C has failed. I'm sorry, Perl ships in the base install of pretty much every single OS I'm aware of, and it is the single easiest way to write things which will consistently work cross platform (from a sysadmin perspective).

Re:Wait, what? (1)

coma_bug (830669) | about a year ago | (#42724569)

This is like saying "grep is useless because nobody's completely redesigned in in the last few months!"

maybe you missed this [wordpress.com]

Re:Wait, what? (0)

Anonymous Coward | about a year ago | (#42724579)

Don't put words into the man's mouth. Noone said 'failure'.

Dude. (0)

Anonymous Coward | about a year ago | (#42724715)

In 1994, I first found Perl. And it completely rocked my world. It ain't '94 any more, and Perl is the *same major version* it was in '95. Perl 6 is due "RSN," and currently holds the award for longest-running vaporware. Perl has completely lost its direction, Larry Wall hasn't been heard from in ages, and nobody cares. Perl's OOP is a joke, hastily retrofitted, to be done right in Perl 6.
Don't get me wrong. I *still* like Perl, and frequently use it. But unless someone injects life into it, yes, it's moribund, and on its way out. I don't say this because I don't like it, but, rather, because it's the simple truth.
PHP, honestly, suffers from many of the same problems -- but unlike Perl, has a direction, hasn't been forked into 73 different competing future versions, and is actively used for what it was made for: web. Python and Ruby rule the roost for new languages that fill in many (most?) of the things Perl 6 would have addressed.
Get me *one* Perl 6 with the Larry Seal of Approval(tm), and I will be willing to retract my words -- because they might no longer be true. But the way things look from where I'm standing, and it's got nowhere to go.

Any talk along this vein (1)

93 Escort Wagon (326346) | about a year ago | (#42723931)

Should also compare the frequency of remotely exploitable flaws in the "replacement" language/framework (e.g. php) versus that of perl.

When was the last actual exploitable perl flaw, anyway?

Re:Any talk along this vein (2)

prefec2 (875483) | about a year ago | (#42724241)

PHP is a nightmare. However, most problems with PHP and Perl-web-applications are the bugs in those applications and not in the language runtime environment.

Still widely used for good reasons (and some bad) (2)

eksith (2776419) | about a year ago | (#42723943)

There's this misconception that Python (the new hotness after some people started getting bored with Ruby) was being adopted purely due to it being new and... well, popular.

We see that Python has a sizable lead on Perl, and oddly, the popularity of Bash has risen sixfold over the past year, breaking into the top 20 for the first time ever.

The fact is that Python today is taking over where Perl would have dominated in the past. That is applications, front-end scripting and where integration of both would be beneficial. If it weren't for Python, I doubt legacy apps that are being migrated away from Perl would have had that path ahead of them. It's a much muddier road through Ruby (not criticism of the language itself, but things are too... different than Python).

Re:Still widely used for good reasons (and some ba (3, Informative)

Viol8 (599362) | about a year ago | (#42723961)

"The fact is that Python today is taking over where Perl would have dominated in the past. "

And the reason for that is that python has equivalent functionality to perl (unless you really need to compose an entire program in 1 line of regexp and a loop), can also be used for quick-n-dirty tasks but is actually readable and structured and while its OO system isn't perfect its a damn site better than the nailed on dogs dinner that is Perls.

Re:Still widely used for good reasons (and some ba (0)

girlintraining (1395911) | about a year ago | (#42724091)

while its OO system isn't perfect its a damn site better than the nailed on dogs dinner that is Perls.

It's not really object oriented until it can do true multiple inheritance. Otherwise, it's just like naugahide... it looks like leather, feels like leather, but it ain't leather and you probably overpaid. That said... yeah... Perl's attempt at OO makes Python look downright sexy.

Re:Still widely used for good reasons (and some ba (3, Informative)

Anonymous Coward | about a year ago | (#42724263)

No. Just no.

Re:Still widely used for good reasons (and some ba (1)

I_Wrote_This (858682) | about a year ago | (#42724121)

....python has equivalent functionality...but is actually readable and structured and while its OO system isn't perfect its a damn site better...

But I (and others) can write structured, OO code in Perl (while having non-OO code where it makes more sense)
And since I'm allowed to lay it out logically, rather than the structure being part of the logic, it is far more readable.
Perl allows you to think, which is why I'll continue to use it.

Re:Still widely used for good reasons (and some ba (1)

Volguus Zildrohar (1618657) | about a year ago | (#42724473)

can write structured, OO code in Perl (while having non-OO code where it makes more sense)

... just like Python.

Perl allows you to think

... just like any language.

Re:Still widely used for good reasons (and some ba (2)

guacamole (24270) | about a year ago | (#42724313)

I agree 100%. Python sets a new standard in simplicity and readability. I don't think Perl 6 will be an improvement upon Python in this area. Python now absorbs all the new users. It even has a big traction in the CS education now (Perl never quite got there). Suffice to mention that big CS departments like MIT and Berkeley have started using Python in their intro to CS courses instead of Lisp. It's on clear to me why anyone other than Unix sysadmins should use Perl for new projects instead of Python. In fact, Python is probably just as fine as a sysadmin tool.

Re:Still widely used for good reasons (and some ba (0)

Anonymous Coward | about a year ago | (#42724445)

You know where Perl's nailed on OO system came from don't you? That's right, Perl's nailed on OO system was lifted from Python. Just without forcing upon the user a single shiny one true way syntax. Underneath the have the same guts. And on those same guts have been developed many OO systems, some of which put Python's to shame. And guess what, my old Perl code runs as well on the Perl of today as it did on the Perl of 15 years ago. How well is your 15 year old Python code doing today?

Re:Still widely used for good reasons (and some ba (1)

Anonymous Coward | about a year ago | (#42724527)

while pythons OO system isn't perfect its a damn site better than the nailed on dogs dinner that is Perls.

Yes, the default OO system in Perl sucks, so take a look at this clean perl object interface called Moose: http://search.cpan.org/~doy/Moose-2.0604/lib/Moose.pm

use it properly and your perl code will be beautiful, usable and maintainable.

Re:Still widely used for good reasons (and some ba (1)

Jahta (1141213) | about a year ago | (#42724071)

For a long time, Perl was one of the first things I installed on any new systems. I wrote tons of stuff in it, from sysadmin scripts to complete web sites.

But over the last 10 years I've moved totally to Python. Increasingly a lot of extensions to Perl felt like hacks. Whereas Python code is very clean by comparison. And consistent. TMTOWTDI [wikipedia.org] sounds a great idea, but for code people depend on, consistency matters more.

Perl (old exotic) (-1, Offtopic)

reinadaley (2827285) | about a year ago | (#42723997)

what Juanita explained I am amazed that a single mom can get paid $6289 in 4 weeks on the internet. did you look at this site FAB33.COM

So, in a few years time... (2)

ebbe11 (121118) | about a year ago | (#42724019)

...Perl will just as dead as Fortran and COBOL.

Re:So, in a few years time... (1)

ColdCat (2586245) | about a year ago | (#42724169)

Unfortunately COBOL is not dead, it's a language I personally dislike but I'm sure there still will be COBOL programs and jobs in 50 years.
In 2000 many programs were updated to support y2k and they are still here
Fortran gain some popularity in the recent years because of the multicores CPU. Intel's Fortran Compiler is maintained and really up to date.
If I could choose everyone will be doing mainly C++ as C++11 is really classy.

Re:So, in a few years time... (1)

dingen (958134) | about a year ago | (#42724267)

Woosh.

That's exactly the point GP was trying to make. Languages never die. Nothing that was used to great extent ever goes away completely. The fact lots of COBOL and Fortran code still lives today proves the point Perl will never go away either.

Perl for sysadmins (1)

Krneki (1192201) | about a year ago | (#42724061)

I decided to learn Perl since I got the impression it was the best scripting tool for a sysadmin dealing whit Windows and Linux environment.

So I have to ask, is Perl still the best tool for me (I love Perl) or should I move on to something else?

Re:Perl for sysadmins (5, Interesting)

guacamole (24270) | about a year ago | (#42724215)

Perl is certainly right for sysadmins. First, Perl borrows heavily the ideas/syntax/cues from the standard unix shell scripting. I am talking about writing scripts with bash, awk, sed, grep, find, tr, etc. If you know them, you will fee right at home. Perl glues the ideas of all of these tools together into a more consistent syntax, and runs much faster than the speed most shell scripts could ever achieve.

Another important issue is the community. Perl community is filled with people who do system administration (not that there aren't other users of perl), so there are tons of libraries, which are available to use as easily as starting Perl's CPAN shell and having it install them automatically. The best book to learn Perl is Larry Walls "Programming Perl". A new edition just came out.

Having said this, I want to mention a that it's a good idea to develop a good sense of judgement. For example, I always got annoyed by some fanboyish coworkers who wrote Perl scripts when a simple shell script would suffice. I have seen perl scripts that are filled with calls to external shell commands, cp and rm and so on which I thought was stupid. (Need a shell script? just write a shell script). And I still loving using awk and similar tools for writing most of "one-liners". I always found awk to be a bit better suited for that than perl. On the other hand, know when to start writing Perl script instead of shell script. Shell scripts can get clumsy very fast.

Another advise, you may also want to check out Python. I was a Perl person, and recently looked into Python, and lo an behold, I am very impressed. In my opinion Python sets a new standard in cleanness and readability. Take a look at the free book "Dive into Python" as well as the official Python 3 tutorial online. Both are short and can be covered in just a few study sessions. Still, in sysadmin world Perl may be more useful, but Python is a great all-around general purpose language.

To see what I mean, take a look at this discussion

http://stackoverflow.com/questions/3775413/what-is-the-perl-version-of-a-python-iterator [stackoverflow.com]

compare the tidy Python code at the top with the proposed Perl solutions below.

Finally, the most striking tool I have used when working as a sysadmin was CFengine. It's the bomb try it. It's a very high level declarative programming language for managing large sites/infrastructures.

Re:Perl for sysadmins (0)

Anonymous Coward | about a year ago | (#42724447)

It's the bomb try it.

I would, but the TSA would come and lock me away...

awk? (1)

tgv (254536) | about a year ago | (#42724111)

With a bit of luck, awk will outlive perl.

Re:awk? (0)

Anonymous Coward | about a year ago | (#42724183)

The only time I ever type awk is when my hands are positioned one key left of where I should be and I'm typing $self

Hideous hideous interface and instruction manual.

Re:awk? (1)

tgv (254536) | about a year ago | (#42724409)

About the manual, I agree. But the "interface"? It's so much cleaner than perl (which is the topic of this thread), and for some tasks pretty elegant, such as inspecting log files, processing dictionaries, tricky find/replace, etc. I wouldn't use it for anything more complex, but I certainly won't be using Perl for that either. I remember writing a Perl script that had to do some kind of diff between two files and wondering why the following line failed

while ( && )

Horrible.

Re:awk? (2)

guacamole (24270) | about a year ago | (#42724637)

Awk is fine strictly as a filter. E.g. read formatted input, do something, write output. If that's all you need to do, awk is often sufficient. Perl on the other hand as a great connectivity to the operating system calls, data bases, networking, etc.

Re:awk? (1)

guacamole (24270) | about a year ago | (#42724341)

Indeed. I prefer writing one-liners in awk. Awk remains a useful domain specific language.

And did you know that there are awk implementations that beat pretty much all other competing programming languages in speed?

See here:

http://brenocon.com/blog/2009/09/dont-mawk-awk-the-fastest-and-most-elegant-big-data-munging-language/ [brenocon.com]

Re:awk? (1)

tgv (254536) | about a year ago | (#42724451)

Thanks for the link. It's great. And how on earth could c++ lose from Java? Seems a certain standard template library sucks.

What is Perl? (4, Insightful)

prefec2 (875483) | about a year ago | (#42724231)

Perl is a historically a combination of bash, awk and sed. And for purposes well suited where people would use the former three tools to implement shell scripts to help administration tasks on a daily basis. However, Perl is not so well suited for other purposes, like small and medium sized web applications. Therefore, it will not gain any more ground in that area, as better tools are available. The first Perl enemy was PHP. While PHP sucks in many ways, it was better designed to write simple dynamic web pages. Today it is used for medium sized web applications, which is clearly a dangerous thing, but still it restricts the growth of Perl in that direction, as younger coders came first in contact with PHP and all the hosters support PHP, but not everyone is supporting Perl. Also things like Joomla or Typo3 are PHP based and many people start coding by extending them.

For custom application or other mostly larger system Java-based or .NET-based technologies are used. Perl has nothing to do in that area. It lost its job there many years ago. InterShop was once coded in Perl, but - well - who cares?

As the Unix command shell is only a limited realm (in number of installations), Perl will never become that widespread again. At least that is my assumption considering today software base and structure, as well as the education in programming languages.

Re:What is Perl? (3, Insightful)

guacamole (24270) | about a year ago | (#42724401)

And then don't forget the threat from Python. Python is a true general purpose scripting language. You can do web applications, sysadmin scripts, or say numerical number crunching (see scipy and numpy). It has very clean and simple syntax rules. On the other hand, Perl looks like an alien language to people who are not familiar with unix.

You can write... (1)

fyngyrz (762201) | about a year ago | (#42724599)

...darn near anything [jamesblish.com] in Python. :)

For those of you unwilling to click through, that's a custom auroral-photography / astro-photography condition reporting system. Even the graphics are generated by Python. It not only lets me look at current conditions, it texts me in case I'm not paying attention when conditions are right for auroral photography. Which leads to photos like these. [flickr.com]

Re:What is Perl? (0)

Anonymous Coward | about a year ago | (#42724623)

It also looks like an alien language even to those of us who grew up on Unix. (That doesn't mean that I don't still use it for one-liners though. But I have moved on to Python for anything beyond that.)

Re:What is Perl? (0)

Anonymous Coward | about a year ago | (#42724723)

However, Perl is not so well suited for other purposes, like small and medium sized web applications.

take that, slashcode!

Industry bias against getting results (0)

Anonymous Coward | about a year ago | (#42724279)

I've noticed a strong industry bias against anything that actually works and gets results. If it isn't an inscrutable functional language or a top-heavy abstract framework, pundits and observers always put it down. Perl is a perennial punching bag because you can get results with it.

Re:Industry bias against getting results (1)

vlm (69642) | about a year ago | (#42724685)

Note the original article is from a journalist. Obviously they have an industry bias against anything that is stable, aka works. In industry, we use what works, thats why 99% of the code on the machines I run is written in C or bash or Perl. Some C++ is slipping in.

slashcode is also perl! (-1)

Anonymous Coward | about a year ago | (#42724575)

"slashdot's Glory Days Are Behind It, But It Isn't Going Anywhere"

I think it was important when Larry asked... (1)

MrKaos (858439) | about a year ago | (#42724651)

When's the last time you used duct tape on a duck?

but I s/t?$/k?$/

Normal evolution (1)

darkat (697582) | about a year ago | (#42724659)

Perl is still tremendously useful as system scripting language (one may prefer bash iif does not know Perl) and text processing. Perl was extended beyond its natural scope because in a certain time lapse, it was the only tool available to do quick prototyping and an aid to quickly deploy complex web applications (particularly). Maybe its true that it has come to the final developement phase. Other languages, more focused on specific purposes and without the limitations/quirks of Perl (TMTOWTDI - There's more than one way to do it - is a problem more that an advantage), have picked up its most useful characteristics, so Perl is no more so central in application development and it will go back to its original scope. If Perl will go extinct it would mean that other , better languages have took its place, but this is not a problem, it's normal evolution.
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...