Slashdot Mirror


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

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.'"

379 comments

  1. Wait, what? by girlintraining · · Score: 5, Insightful

    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.

    --
    #fuckbeta #iamslashdot #dicemustdie
    1. Re:Wait, what? by EzInKy · · Score: 0

      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..

      --
      Time is what keeps everything from happening all at once.
    2. Re:Wait, what? by LordLucless · · Score: 4, Insightful

      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.

      --
      Just because you're paranoid doesn't mean there isn't an invisible demon about to eat your face
    3. Re:Wait, what? by jellomizer · · Score: 2, Insightful

      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.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    4. Re:Wait, what? by Anonymous Coward · · Score: 0

      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

    5. Re:Wait, what? by dkf · · Score: 2

      [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.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    6. Re:Wait, what? by girlintraining · · Score: 5, Interesting

      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. The author here mentions PHP, Ruby, and Python. A separate analysis 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. 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.

      --
      #fuckbeta #iamslashdot #dicemustdie
    7. Re:Wait, what? by dargaud · · Score: 3, Insightful
      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.

      --
      Non-Linux Penguins ?
    8. Re:Wait, what? by Anonymous Coward · · Score: 0

      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.

    9. Re:Wait, what? by gigaherz · · Score: 1

      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.

    10. Re:Wait, what? by girlintraining · · Score: 5, Interesting

      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, 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.

      --
      #fuckbeta #iamslashdot #dicemustdie
    11. Re:Wait, what? by Anonymous Coward · · Score: 0, Funny

      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. :-)

    12. Re:Wait, what? by tlambert · · Score: 3, Insightful

      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.

    13. Re:Wait, what? by Anonymous Coward · · Score: 1

      Sorry man, but PERL is just too damn scary.

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

    14. Re:Wait, what? by girlintraining · · Score: 3, Interesting

      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.

      --
      #fuckbeta #iamslashdot #dicemustdie
    15. Re:Wait, what? by e**(i+pi)-1 · · Score: 2

      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.

    16. Re:Wait, what? by Sique · · Score: 0

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

      --
      .sig: Sique *sigh*
    17. Re:Wait, what? by solidraven · · Score: 5, Insightful

      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.

    18. Re:Wait, what? by TheLink · · Score: 1

      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.

      --
    19. Re:Wait, what? by Viol8 · · Score: 2

      "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.

    20. Re:Wait, what? by LordLucless · · Score: 1

      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.

      --
      Just because you're paranoid doesn't mean there isn't an invisible demon about to eat your face
    21. Re:Wait, what? by Sique · · Score: 1

      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.

      --
      .sig: Sique *sigh*
    22. Re:Wait, what? by Anonymous Coward · · Score: 1

      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"?

    23. Re:Wait, what? by Richard_at_work · · Score: 1

      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.

    24. Re:Wait, what? by Anonymous Coward · · Score: 4, Informative

      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.

    25. Re:Wait, what? by ThePhilips · · Score: 4, Insightful

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

      --
      All hope abandon ye who enter here.
    26. Re:Wait, what? by Anonymous Coward · · Score: 0

      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.

    27. Re:Wait, what? by Anonymous Coward · · Score: 0

      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.

    28. Re:Wait, what? by benjfowler · · Score: 1

      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.

    29. Re:Wait, what? by Tridus · · Score: 4, Insightful

      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.

      --
      -- "So they told me that using the download page to download something was not something they anticipated." - Bill Gates
    30. Re:Wait, what? by rgbatduke · · Score: 3, Interesting

      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

      --
      Even when the experts all agree, they may well be mistaken. --- Bertrand Russell.
    31. Re:Wait, what? by Anonymous Coward · · Score: 0

      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

    32. Re:Wait, what? by CAIMLAS · · Score: 1

      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).

      --
      ~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
    33. Re:Wait, what? by Viol8 · · Score: 3, Interesting

      "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.

    34. Re:Wait, what? by ThePhilips · · Score: 2

      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. 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.

      --
      All hope abandon ye who enter here.
    35. Re:Wait, what? by stjobe · · Score: 3, Informative

      From perlfaq1:

      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:

      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.

      --
      "Total destruction the only solution" - Bob Marley
    36. Re:Wait, what? by vlm · · Score: 1

      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?

      --
      "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
    37. Re:Wait, what? by coma_bug · · Score: 1

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

      maybe you missed this

    38. Re:Wait, what? by cmdr_tofu · · Score: 2, Interesting

      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.

    39. Re:Wait, what? by Anonymous Coward · · Score: 0

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

    40. Re:Wait, what? by arielCo · · Score: 4, Insightful

      $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.

      --
      This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
    41. Re:Wait, what? by guacamole · · Score: 2

      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.

    42. Re:Wait, what? by spxZA · · Score: 5, Informative

      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!

    43. Re:Wait, what? by smpoole7 · · Score: 2

      > actual interactive GUI applications

      Or games. :)

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

      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. :)

      --
      Cogito, igitur comedam pizza.
    44. Re:Wait, what? by cgaertner · · Score: 1

      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.

    45. Re:Wait, what? by LordLucless · · Score: 1

      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.

      --
      Just because you're paranoid doesn't mean there isn't an invisible demon about to eat your face
    46. Re:Wait, what? by mooingyak · · Score: 2

      $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?

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    47. Re:Wait, what? by LordLucless · · Score: 1

      Yeah. Hence:

      That methodology has its own flaws

      --
      Just because you're paranoid doesn't mean there isn't an invisible demon about to eat your face
    48. Re:Wait, what? by smpoole7 · · Score: 1

      > 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++.

      --
      Cogito, igitur comedam pizza.
    49. Re:Wait, what? by guacamole · · Score: 1

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

    50. Re:Wait, what? by laffer1 · · Score: 3, Interesting

      I don't think less people are using Perl. I think young people aren't using perl. The hot thing is Python and JavaScript solutions for everything. Python can be used for GUIs, crazy admin scripts, etc. It can be used in place of Perl, but it will never replace Perl. Python doesn't have CPAN. Python code is just as bad as Perl code sometimes, because people who use both languages are sometimes too clever for their own good. Personally, Perl makes more sense to me than Python. I get why people like Python, but it's not for me. After trying to port it to MidnightBSD, I had to look inside and I was not impressed. Then there's the whole Python 3 thing... too many people still use Python 2.x. Python 3 is what will happen if Perl ever actually goes to 6.0 (mainstream). You'll have a fork and then death of the language long term. It's only a matter of time. I think the Python community either has to go back to 2.x or kill security updates on it so it forces people to adopt 3.x.

      No one has ever shown me a feature in Python I can't live without. I would never write a GUI in Perl, but I also think it's ridiculous in python aside from prototyping. If you want evidence of why I feel that way, look at many Gnome projects. I have done it once as a script to create PDFs of web pages with their actual rendering from WebKit bindings for my previous employer and I got a bad taste in my mouth.

    51. Re:Wait, what? by Schmorgluck · · Score: 1

      You know, a programmer rereading the code may need to know the kind of a variable, too. Yeah, I know, naming conventions, yadda, yadda. But it's also useful for managing contexts.

      --
      There's nothing like $HOME
    52. Re:Wait, what? by Anonymous Coward · · Score: 0

      I don't think comparing Perl to PHP, Python and/or Ruby is a good idea. Those programming language are all int he same boat ; Young aren't interested in learning them anymore.

      There was a time when learning a new programming language was a hobby. You eared about some cool stuff that have been done with Pearl, bought the book and read the whole thing. Nowadays if you try to learn a new language and cannot find the solution of the problem easily on some forum, you give up.

      Even if Pearl fare better in some case, it cannot compete anymore again C, C++, C#, VB.NET and, or course, Java. Hell even VHDL is starting to be dropped in my university.

    53. Re:Wait, what? by lazybeam · · Score: 1

      I write "new" programs in perl every day. Often it's just a -e from the command line, to do some Q&D text-processing, but they are new!

      --
      --
      no sig for you. come back one year.
    54. Re:Wait, what? by arielCo · · Score: 2

      Not to someone who already knows Perl, because by the time he sees that he's already familiar with $foo, @foo, $foo[2] (third element in @foo), %foo, $foo{'bar'} (value stored in %foo under 'bar'), though it IS bad form. Yes, it's not for the casual observer and *really* messy code can be written, but good style helps a lot.

      --
      This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
    55. Re:Wait, what? by Anonymous Coward · · Score: 1

      we actually think of the sigil as *part* of the name, as in "dollar foo" and "percent foo"

      If only it were so in Perl!

      If you have a scalar variable $foo and an array variable @foo, and you want to access the element 3 of the array, what do you write? Well, the logical choice would be @foo[3] because, after all, it is an element of the array variable @foo you are accessing, not the completely unrelated scalar variable $foo. But that's not how Perl works. In Perl, you have to write $foo[3] because the third element of the array is a scalar. So you have here a mention of the name $foo which does not refer to the variable $foo but to the completely unrelated variable @foo.

      So you can neither consider the sigil part of the name (depending on how you use it, you'll have to refer to the same variable either with $foo) or with @foo, nor consider the sigil not part of the name ($foo and @foo when used in isolation will refer to different, unrelated variables).

      Note that in Perl 6, the sigil actually is part of the name, with no exceptions. Which is an implicit admission that this changing sigil thing wasn't a good idea to begin with.

    56. Re:Wait, what? by Anonymous Coward · · Score: 0

      Perl ships in the base install of pretty much every single OS I'm aware of

      Perl ships in the basi install of Windows?

    57. Re:Wait, what? by Rysc · · Score: 1

      Most modern languages have caught up to Perl5 in terms of basic regex power, so using Perl5 for its regex is no longer quite so essential in that you can probably get as powerful a system as you probably need in any language. That said, Perl5 *still* has regex features no one else has (or perhaps that no one else is crazy enough to implement.) For better or for worse, it's still the best... ...until you look at Perl6. Okay, so Perl6 is not done yet, but when it is the bar for regular expressions will instantly go up again. There's absolutely no competition for what it does, no other language has first class Perl6-style regex.

      --
      I want my Cowboyneal
    58. Re:Wait, what? by rgbatduke · · Score: 2

      I used Perl-Tk for mine -- SDL wasn't around yet IIRC, nor was Gtk, and I was porting an interface I originally wrote in Tcl/Tk once I realized that Tcl was insanely out of sync with the way I think and code. In the end it worked perfectly, but it was a bit of a mess to write. Not an exercise I'm eager to repeat (and I long since learned to code in C/Gtk for the same kind of application), but I still have the source squirrelled away in case I ever need to recycle it in some way. But the amazing thing about a dancing bear isn't how gracefully it dances but that it dances at all. A >>simple Tk interface in perl was, and probably still is, a piece of cake and you have all of that string parsing power just sitting there at your beck and call.

      Games, though -- wow! But then, as one of the top posters noted perl is relatively efficient as scripting languages go, sometimes within an order of magnitude of compiled code. Hard to do much better than that with any of the languages that do dynamical allocation of all variables as you use them, creating everything as complex opaque hashes behind the scene just so you can address a[34] without defining or allocating a or even assigning values or referencing a[0] to a[33] (where I'm deliberately leaving off the $ -- this remark isn't only about perl). The same thing that makes it perfect for sloppy one-offs makes it slow for everything else, but slow is relative, given computers with several billion instructions per second at your disposal. In lots of cases, the time required to write the program is vastly greater than the time required to run it, so writing in an easy and forgiving language where you can dash off working code in thirty minutes instead of a couple of days is totally worth it.

      rgb

      --
      Even when the experts all agree, they may well be mistaken. --- Bertrand Russell.
    59. Re:Wait, what? by TheCarp · · Score: 1

      I think you are missing the point of "glory days". People don't die after their Glory days.... they are their glory days precisely because they spend the rest of their lives talking about them (four touchdowns in a single game!).

      Its the end of being newsworthy and interesting, not the end of productive work.

      --
      "I opened my eyes, and everything went dark again"
    60. Re:Wait, what? by talexb · · Score: 1

      Actually, $foo[3] is the *fourth* element of @foo. You count the array elements starting at 0, just like in C and assembler. Yes, $foo and @foo are completely different variables. Welcome to Perl.

    61. Re:Wait, what? by mooingyak · · Score: 1

      My complaint with your argument lies in reconciling that syntax with this statement:

      (we actually think of the sigil as *part* of the name, as in "dollar foo" and "percent foo")

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    62. Re:Wait, what? by SoupIsGood+Food · · Score: 1

      I remember when the O'Reilly Python manual came out and everyone was excited - this was back in Clinton's first term of office. Python is old. Interpreted languages in general are old, and increasingly less useful. Javascript is transforming from an interpreted language into a compilation target due to its integration with web technologies - Python is just python. Jython was a thing for a while, but it's not functional-language enough to handle new virtual and cloud infrastructures, where an app has to run on thousands of machines, scaling up to thousands more in response to load, all without operator intervention.

      Languages that are not legacy compile to JVM, CLR and/or Javascript - Clojure, CoffeeScript, Opa.

    63. Re:Wait, what? by Anonymous Coward · · Score: 0

      And you can't make an object-oriented successor to C because there's already C++, right? Look at Objective-C,

      That one was developed in parallel to C++.

      D,

      That one is explicitly meant as "successor" to C++ ("successor" in quotes because it's actually a quite different language, which is neither C nor C++ compatible).

      Vala

      I never heard about that before.

      ECMAScript 4

      I hope you're not trying to imply that this is a successor to C. It is a very different language.

    64. Re:Wait, what? by Rysc · · Score: 3, Informative

      Confusing is in the eye of the beholder. Consider

      sub read_file{
          my $file = shift;
          open(FILE, $file) or die "$!";
          chomp(my @file = <FILE>);
          close(FILE) or die "$!";
       
          my %file;
          while my $line (@file){
              my($key, $value) = split /=/, $line;
              $file{$key} = $value;
          }
          return %file;
      }

      To a Perl programmer this is all very clear despite having multiple things called 'file' in the same scope. What would you prefer? "$file, $file_handle, $file_array, $file_hash"? There are a lot of things you could do instead but they're not much clearer or easier to read, and this is more than sufficiently clear.

      And before you say anything, yeah this is not the best way to write such a function. If you're thinking "WTF?" the answer is "For illustration I went with something that should be fairly clear to non-Perl people" and "I'm trying to use as many different types of variable as possible."

      --
      I want my Cowboyneal
    65. Re:Wait, what? by Rysc · · Score: 1

      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.

      I find this funny, because after stagnating for a few years waiting on perl6 the development of perl5 did pick back up (not a fork, but a renewal) a few years ago and is going strong. Useful things are being added, the code is being improved, and so on.

      --
      I want my Cowboyneal
    66. Re:Wait, what? by arielCo · · Score: 1

      Sorry, the 'sigil part of the name' explanation only meant that in my head there's a foo array and a foo scalar. As I understand it, the sigil is a type indicator for the expression and which object is accessed is 'inferred'. The messier ones demonstrate it more "clearly" (!), e.g. those where you enclose everything in %( ).

      Maybe Perl 6 should be called something else. For what I know it's different enough from Perl 5 to require rewriting code, but OTOH that may decrease resistance to adoption among PHBs ("so it's a new version, right?") and it may sound like "venerable, proven language updated". If it ever comes out.

      --
      This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
    67. Re:Wait, what? by Anonymous Coward · · Score: 0

      Actually, $foo[3] is the *fourth* element of @foo.

      Yes, that's why I wrote "the element 3", not "the third element". The first element of the array is element 0.

    68. Re:Wait, what? by h4rr4r · · Score: 1

      Most of?
      This language is only a few years old. Perl is 20 and still works. In 20 years .NET code will be unusable. MS will have changed to something else.

    69. Re:Wait, what? by FatdogHaiku · · Score: 1

      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.

      Obligatory XKCD confirmation:
      http://xkcd.com/224/

      --
      You have the right to remain sentient. If you give up the right to remain sentient, you will be elected to public office
    70. Re:Wait, what? by DuckDodgers · · Score: 1

      I think there are two separate points the writer brings up. The first, that Perl is not changing, is - as you say - an advantage and not a problem.

      But the second point is that Perl use is declining. It's declining slowly, but it's declining and fewer new projects use it. For fans of the language that would rather see it in use than, say, PHP, Ruby, Python, or even Java or C#, that is a problem.

    71. Re:Wait, what? by dkleinsc · · Score: 1

      There is no good reason for having to tell the interpreter the type of the variable once its been created. It should already know.

      I always saw those kind of symbols as reminders for the programmer, not for the interpreter / compiler. One of the many dumb decisions in PHP is using $ for all variables, regardless of whether $foo is a scalar, a hash, an object, a list, or something completely different.

      --
      I am officially gone from /. Long live http://www.soylentnews.com/
    72. Re:Wait, what? by psmears · · Score: 1

      Actually, $foo[3] is the *fourth* element of @foo. You count the array elements starting at 0, just like in C and assembler.

      Not necessarily: it depends on the value of the $[ variable. Which isn't actually a variable. (Yes, Perl variable names can consist purely of punctuation. Yes, there are things that look like variables but actually aren't. Yes, you can override the index from which arrays are numbered.)

    73. Re:Wait, what? by muon-catalyzed · · Score: 4, Funny

      >You are not supposed to understand the code

      Right, that is because Perl is the only language whose code looks the same before and after RSA encryption.

    74. Re:Wait, what? by psmears · · Score: 1

      Actually, $foo[3] is the *fourth* element of @foo.

      Yes, that's why I wrote "the element 3", not "the third element".

      Yes, but unfortunately you let one "third" slip through the net:

      In Perl, you have to write $foo[3] because the third element of the array is a scalar.

      I'm sure $[ was equal to one for that sentence, though ;-)

    75. Re:Wait, what? by cgaertner · · Score: 1

      And you can't make an object-oriented successor to C because there's already C++, right? Look at Objective-C,

      That one was developed in parallel to C++.

      And a hypothetical Perl5++ would be developed in parallel to Perl6. Just because C++ was officially relased first did not stop adoption of Objective-C.

      D,

      That one is explicitly meant as "successor" to C++ ("successor" in quotes because it's actually a quite different language, which is neither C nor C++ compatible).

      D is not meant as a successor of C++, but a replacement. The relationship between Perl5++ and Perl5, Perl6 and Perl5, Perl5++ and Perl6 would be pretty close to the relationship between C++ and C (mostly compatible superset), D and C (new language with cleaner semantics, more comprehensise featureset but still close in spirit), C++ and D (siblings with shared heritage) except for the fact that Perl6 would predate Perl5++.

      Vala

      I never heard about that before.

      A C#-inspired language leveraging the GObject object system that compiles to C.

      ECMAScript 4

      I hope you're not trying to imply that this is a successor to C. It is a very different language.

      ES3:ES4:ES5 == Perl5:Perl6:Perl5++, except that Perl5++ is a pipe dream right now and Perl6 not dead.

    76. Re:Wait, what? by ThePhilips · · Score: 1

      Yes, Perl5 is well maintained. But I doubt very much that we would see any big feature introduced, since it has to remain backward-compatible.

      --
      All hope abandon ye who enter here.
    77. Re:Wait, what? by dskoll · · Score: 3, Insightful

      That's utter nonsense. Perl's DBI modules are fantastic for DB access.

      Perl is just not shiny and new any more. It's still used in a lot of places. Our commercial products are written in Perl and I like the fact that Perl isn't changing wildly. Perl 6 worried me for a while, but it's obvious that Perl 6 is going nowhere and Perl 5 is continuing to be maintained.

    78. Re:Wait, what? by Schmorgluck · · Score: 1

      Yes, you can override the index from which arrays are numbered.

      And this kind of practice is nicknamed Black Magic, for good reasons. Not to be done unless you really need to.

      --
      There's nothing like $HOME
    79. Re:Wait, what? by VGPowerlord · · Score: 1

      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?

      Google employs the developer of Python... and its other official language is Java.

      Facebook is the company who decided to use PHP and realized too late that it's too slow for what they need.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    80. Re:Wait, what? by serviscope_minor · · Score: 0, Troll

      C/C++,

      How do you write in C/C++? Using the common subset of both? You might like to try C++, it's very nice.

      --
      SJW n. One who posts facts.
    81. Re:Wait, what? by jellomizer · · Score: 1

      It isn't about how good Perl is with DB. It is the fact the language design was for text processing... You switch your data to a Database, Perl isn't doing what it is good at. You are better off with languages that are easier to read.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    82. Re:Wait, what? by theCoder · · Score: 1

      In technology, "legacy" is a derogatory term used to describe technology the speaker doesn't like and wishes others stopped using. For example, "the Linux enthusiast suggested migrating from the legacy Windows clients to Linux" or "the Microsoft salesperson recommended migrating from legacy Linux servers to new Windows 8 servers".

      Personally, I like to use it as a joke to tweak fanbois :)

      --
      "Save the whales, feed the hungry, free the mallocs" -- author unknown
    83. Re:Wait, what? by stridebird · · Score: 1

      heh, well it increases the name space at least. $var != @var

      Perl was my first web language, fond memories.

    84. Re:Wait, what? by Bogtha · · Score: 2

      One of Perl's biggest uses was web development. At one point, server-side web development was totally dominated by Perl. These days it's a niche player.

      The other biggest use was sysadmin scripting. Again, it is rapidly falling by the wayside as systems like Chef and Puppet automate away a lot of it and Ruby and Python are growing in popularity for the rest.

      This isn't about times changing and people needing different things. Perl's getting outpaced in areas where it has traditionally been extremely strong.

      --
      Bogtha Bogtha Bogtha
    85. Re:Wait, what? by fotoguzzi · · Score: 1

      The Learning Perl book always showed more than one way to do it but usually advised that the boss might not go for some of the clever examples and that readable code was a laudable objective. I understand that with Python there is often only one way to do something. How about Ruby? Is it somewhere in the middle? And would forum regulars eventually try to rewrite your code to nothing or would they tell you how to improve what you had which almost worked?

      --
      Their they're doing there hair.
    86. Re:Wait, what? by Wdomburg · · Score: 1

      Sure, part of the name, unless you're referencing a element (i.e. '@foo = (1,2,3); $foo = "bar"; print $foo[0]')

      So in order to reference a variable that allegedly included the sigil as part of it's "name" you have to type in the "name" of another variable that "is not the same" and "coexist[s] without interference". This sucks and *is* confusing. Which is why they changed it in perl6.

    87. Re:Wait, what? by Rysc · · Score: 1

      It rather depends on what you call a "big feature" - syntactically not much is likely to change, that's true. On the other hand if you look at the list of changes from the latest stable release it's clear that many things continue to be improved, even more so if you look at the sum of all changes from 5.12 forward (aka the modern perl5 era).

      --
      I want my Cowboyneal
    88. Re:Wait, what? by Anonymous Coward · · Score: 0

      One of the main points of Perl is easy manipulation of text content. A string like "In $city there are $population people, with average income $averageIncome." is significantly clearer than the Java way, for example. Those $ really help.

      From the camelCase, you probably can guess that I'm from Java background myself. I like using Perl for quick scripts. Half my lines are shell commands, as I haven't bothered to learn the true Perl way, but the fact you can code like that makes it very appealing to me.

      If you try to use Perl for something else than scripting, you are probably using the wrong language.

    89. Re:Wait, what? by Anonymous Coward · · Score: 0

      The problem (not just Perl, but PHP and Javascript) is that the developers keep being told to make it a OOP language and add features, that aren't needed. These languages don't need to be OOP, and as soon as they gain such features, there is rapid abandonment of the language because it's now to damn complicated to get things to "Just Work"

      Not everything has to be as complicated as C++ or Java.

      What ultimately makes Perl useless for long-term use is how the CPAN system's connection to requiring libraries from other languages to function. Everytime Perl is updated, you have to update everything, and if the library has updated, now you have to fight the version the operating system expects to exist with the version CPAN demands to have. PHP tends not to work this way (It has PEAR) and crap is less broken in PEAR, but it's still a nusiance. The end result is PERL tends to have Not-invented-here programmers that shun existing libraries for making their own. I don't know how many times I just threw away a CPAN module and wrote something from scratch because the CPAN module just didn't work.

      Like my perspective is that you should use Perl, but not rely on CPAN for doing anything. The most I ever use is DBI/DBD for mysql and that's all I ever need. With PHP, it comes with mysql support out of the box.

      But I reiterate again, the soon as you force the language to go OOP, all hell breaks loose, and developers who liked the simplicity of the language go elsewhere. Python and Ruby are OOP out of the box, so unless you like OOP to begin with, you're not going to use these languages either.

      *I have nothing against OOP, what I hate is how the programming style of OOP makes what could have been a dozen line function into thousands of lines of overrides and extensions, that makes it impossible to figure out what you're going to break. This is a nightmare for opensource advocates, because one change you make, may break thousands of peoples use of your library or software if they've extended it.

    90. Re:Wait, what? by Fallingcow · · Score: 1

      In Ruby there are usually many ways to do something, but only one that doesn't make you feel dirty.

    91. Re:Wait, what? by Samantha+Wright · · Score: 1

      Yeah, well... in APL, that incomprehensible one-liner would be about three characters!

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    92. Re:Wait, what? by Richard_J_N · · Score: 1

      Interestingly, that's not the whole story.

      In Bash, the $ sign is a unary operator that means "replace NAME by its VALUE". That's why, in Bash, assignment of variables is done without $ signs. For example:
      fruit=apple; echo $fruit. It's also why the bash shell allows $ to do so many things, such as ${filename%.extn} (strip off the extension from a filename).

      In PHP, $ isn't an operator, but a symbol that means "variable". This is useful for clarity, especially when there are so many keywords around, and when a variable could be auto-vivified (and shouldn't be confused with a constant, or an unknown keyword).

      Also, interestingly, $1 and $2 etc are meaningful in Bash and Perl, but in PHP, they are NOT variables. They get used in SQL query parameters, but otherwise, the $ is considered literal. Eg echo "this is $1"

      Perl distinguishes variable scope between scalar/array/hash. PHP allows a variable to be either (and sometimes to swap types), and considers "array" and "hash" to be basically the same thing.

       

    93. Re:Wait, what? by Lodragandraoidh · · Score: 1

      Yes, it's not for the casual observer and *really* messy code can be written, but good style helps a lot.

      The key problem: assuming that everyone on a team of programmers will have the wherewithall to write non-messy code.

      Murphy's Law, combined with a gaggle of people working on a project obviates your statement.

      --

      Lodragan Draoidh
      The more you explain it, the more I don't understand it. - Mark Twain
    94. Re:Wait, what? by spike+hay · · Score: 1

      Scripting languages are always, always vastly slower than compiled languages like C or Fortran. That's why they are often used as "glue" languages, and you never want to do big loopy things in them.

      --
      If you don't understand any of my sayings, come to me in private and I shall take you in my German mouth.
    95. Re:Wait, what? by Anonymous Coward · · Score: 0

      Dude, the multi-line lambda argument is weaksauce.
      If you want a fucking lambda just define the function inside your function.
      Yo dawg, I heard you liek functions? So I put a function i your function!

      def yo():
              def dawg():
                      return('So I put a function in your function!')
              print 'Yo dawg, I heard you like functions. {}'.format(dawg())'

      Man that was so hard....waaahhhhh I want to be able to call it lambda so it sounds cool and newbs won't know what I'm talking about....waaaaahhhhhh....

      U R WEAKSAUCE

    96. Re:Wait, what? by arielCo · · Score: 1

      Yup, that was inaccurate; I came up with it only to tell Viol8 (599362) that the sigils are not there just for fun. I wrote a better-thought explanation in another post for someone who already knows Perl:

      Sorry, the 'sigil part of the name' explanation only meant that in my head there's a foo array and a foo scalar. As I understand it, the sigil is a type indicator for the expression and which object is accessed is 'inferred'. The messier ones demonstrate it more "clearly" (!), e.g. those where you enclose everything in %( ).

      So @foo{('curly','larry','moe')} actually means something like "the list of values resulting from looking up ('curly', 'larry', 'moe') in some hash foo (implied by the { })"; it will throw an error or warning if there is no hash foo to apply the { } to. The same way, @foo means "a list of values from foo", so there had better be an array named foo.

      Maybe a real Perl monk will correct me. A few concepts in Perl are peculiar, like "every expression ultimately yields a flat list", and references, but Perl is a language for the long run and you get used to them.

      --
      This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
    97. Re:Wait, what? by cats · · Score: 1

      Look at all that garbage...tsk...tsk...

      def read_file(filename):
              with open(filename, 'r') as fh:
                      perl_sucks = dict()
                      for line in fh:
                              key, value = line.split('=')
                              perl_sucks[key] = value
                      return perl_sucks

      You iterated through the file twice to do the same thing. Python will handle the file handle closing for you, and if the open fails the function will throw an exception which we can handle inside the calling function.

      In short, Larry Wall is the GRIDS of programming language design, he mostly affects gay men and intravenous drug users, but every once in a while some poor kid in Indiana is going to get infected and there is no cure!

    98. Re:Wait, what? by RoccamOccam · · Score: 1

      Google employs the developer of Python...

      No longer true. It is my understanding that Guido Van Rossum now works for Dropbox.

    99. Re:Wait, what? by Anonymous Coward · · Score: 0

      Also sigils are what make variable interpolation in strings possible...python must resort to sprintf-like formatting.
      $foo = 'scalar';
      print "foo is a $foo variable";
      vs
      foo = 'python'
      print "foo is a %s variable" % foo

    100. Re:Wait, what? by AuMatar · · Score: 1

      Perl 6 has been just around the corner for 13 years. At this point do you really think it will ever actually be finished? If they were actually serious about it it would have come out a decade ago.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    101. Re:Wait, what? by Anonymous Coward · · Score: 0

      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?

      Yes, you can have that, and yes it can be confusing. That's why many of us avoid that sort of situation. But it's nice to have the rope available, because, you know, some of us wear big boy pants and can handle the responsibility.

    102. Re:Wait, what? by Anonymous Coward · · Score: 0

      With no real roadmap for the last 10 years, and the whole Perl 6 debacle, IMO it is completely fair to call Perl 5 a 'legacy language'. It's not going anywhere.

      One can already envision old Gen X programmers getting called out of retirement to fix ancient WTF perl code.

    103. Re:Wait, what? by Wdomburg · · Score: 2

      Not particularly good naming, you're calling a file name, lines of input and formated output all "file". With more sensible naming:

      sub read_file{
              my $filename = shift;
              open(FILE, $filename) or die "$!";
              chomp(my @lines = );
              close(FILE) or die "$!";

              my %data;
              while my $line (@lines){
                      my($key, $value) = split /=/, $line;
                      $data{$key} = $value;
              }
              return %data;
      }

      Of course once you remove the dubious reuse of the same variable name for different types, the sigils are rendered unnecessary and confusing. The same steps in Ruby:

      def read_file(filename)

              file = File.open(filename)
              lines = file.read.split($/)
              file.close

              data = {}
              lines.each do |line|
                      key,value = line.split('=')
                      data[key] = value
              end

              data
      end

      Which looks cleaner?

    104. Re:Wait, what? by arielCo · · Score: 1

      Actually that was a poor explanation on my part; I meant "the scalar foo" and "the array foo" but mentally I pronounce them as "dollar foo" and "at foo". The sigil is not really a part of the name but a type indicator for the expression, and the actual storage accessed for an identifier is inferred from the way it's used (e.g. the brackets). More here: http://slashdot.org/comments.pl?sid=3415413&cid=42726695

      I'm really curious about Perl 6; it will take some (un-)learning and I'm not whether it can succeed among Python, Ruby, and Perl 5 (I doubt that legacy code can simply be reused).

      --
      This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
    105. Re:Wait, what? by AuMatar · · Score: 1

      Yes, because nobody who writes in any other language indents for style reasons. Oh wait, EVERYONE does.

      Meanwhile Python has actively cost me at least 2 weeks of time tracking down bugs that ended up being due to mixing of tabs and spaces causing incorrect nesting levels, but nobody could see it because it looked ok on the screen. No other language has ever caused me that.

      Until Python loses that feature, its a complete non-starter to a lot of programmers. I despise perl, but I'd rather deal with line noise syntax and lack of an object model than python's whitespace issues.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    106. Re:Wait, what? by AuMatar · · Score: 1

      No, perl arrays normally start from 0- unless you've overwritten perls $[ variable. Then they start from whatever you want.

      Yes, that is fucking braindead. Its things like this that caused much of the perl hatred.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    107. Re:Wait, what? by Rysc · · Score: 1

      Yes, thanks for missing the point. I *deliberately* chose an example where the with-sigil variables *allow* you to name different things the same way without it being confusing. Of course you *can* choose names, as I said in my post, which are not the same. Would you care to choose another example of *using variables with different sigils but otherwise the same names*? Because, you know, *that was the whole point of the example*.

      --
      I want my Cowboyneal
    108. Re:Wait, what? by AuMatar · · Score: 1

      Disagree. This would be MUCH clearer with better names. $file should be $filename. @file should be @fileLines or @fileData, to show that it holds the data from the file. %file should be something either naming the type of data used in it, or for a very generic function like that named to show that its the result of the operation. This would not pass a code review in any organization I've ever been part of.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    109. Re:Wait, what? by AuMatar · · Score: 1

      Not to be done, period. There is no reason to really need to, and it garuntees that nobody will ever understand your code.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    110. Re:Wait, what? by Anonymous Coward · · Score: 0

      Actually it would be possible to use "$" (or "%") as "interpolation marker" even if not part of the variable name. That is, you could define that the string "foo is a $foo variable" looks up the variable foo (instead of the variable $foo) and interpolates it. Indeed, that's exactly how bash variable expansion works (except that it is done this way also in all other places where shell variables are used):

      foo="shell" # no dollar sign
      echo "foo is a $foo variable"

    111. Re:Wait, what? by Rysc · · Score: 1

      Yes, also thanks to you for missing the point. I was not demonstrating best Perl practices, either in naming or code style or efficiency. Yes, all of the cool things you mentioned about Python work in Perl, too! I am not doing a feature comparison chart. Congratulations, you can write a better function to read a file! You know what? So can I. Now we're *all* special, together.

      --
      I want my Cowboyneal
    112. Re:Wait, what? by Talderas · · Score: 1

      I understand SQL a lot better than what I can do with Perl. That said, I use Perl to dump data from our ERP's flat file into a relational database so that we can perform good reporting instead of crap reporting.

      --
      "Lack of speed can be overcome. In the worst case by patience." --Znork
    113. Re:Wait, what? by Jay+Juch · · Score: 1

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

      I have little story that may back this up a bit. Recently, I had a reason to write a small command line tool that parses through thousands of xml message files looking for an out of order sequence. I am a c#/java developer but I thought this would be a great opportunity for me to renew my scripting skills. I started scratching away at it using perl. Not long in to it I realized xml parsing/validation/xpath was going to be an issue. There was a ton of 3rd party libraries, each lacking some key feature. And all had awful documentation. I took a peek at xml support on python. It seemed a little better but it was still going to a harrowing search through various libraries. In the end, I did it java. I am sure if I had more time I could have done it in perl or python.

    114. Re:Wait, what? by Anonymous Coward · · Score: 0

      as much as they are copy-pasting it en masse

      As if that isn't what "programming" perl largely consisted of.

    115. Re:Wait, what? by Rysc · · Score: 1

      It's not as if there's been no progress. It's much more around the corner now than it was 10 years ago, it's quite close to done now.

      --
      I want my Cowboyneal
    116. Re:Wait, what? by DutchUncle · · Score: 1

      Mod parent up. Please. STABILITY is what allows people to ship PRODUCTS for MONEY, which pays the electric bills for all these tubes.

    117. Re:Wait, what? by Bill,+Shooter+of+Bul · · Score: 1

      Really? So c++, legacy? Google's brand spanking new go language, legacy? Objective C-- legacy? What serious database (sql speaking or not) or operating system is written in a "non-legacy" language?

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    118. Re:Wait, what? by mooingyak · · Score: 1

      To a Perl programmer this is all very clear despite having multiple things called 'file' in the same scope. What would you prefer? "$file, $file_handle, $file_array, $file_hash"? There are a lot of things you could do instead but they're not much clearer or easier to read, and this is more than sufficiently clear.

      Before I say anything else: I understand that your code is illustrative and not intended to be an example of how to read a file.

      That said, I do feel that discrete names provide better clarity, and don't believe that having distinct symbol tables for each variable type is beneficial. Clearly YMMV (and it seems, DOES vary).

      BTW, I think the guy who wrote the ruby version also understood what you were doing. His point (and mine, to a lesser degree) is that if you use distinct names, which he and I both appear to prefer, then the sigils become clutter.

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    119. Re:Wait, what? by shaitand · · Score: 1

      "Most modern languages have caught up to Perl5 in terms of basic regex power"

      Most modern languages implement a Perl Compatible Regular Expression engine and have most (but not all) of the features but certainly not in terms of speed.

    120. Re:Wait, what? by Schmorgluck · · Score: 1

      Never say never. This still can be useful in marginal cases (never happened to me, and pretty unlikely to ever happen). However, this must be done within a limited scope by using the local operator, and with thorough documentation. These advices apply everytime you have to modify a "magic variable" (the most often modified variable is the record separator $/).

      --
      There's nothing like $HOME
    121. Re:Wait, what? by Wdomburg · · Score: 1

      You specifically asked, "What would you prefer?" and gave silly alternatives. I gave suggestions that are clearer and more accurately reflect the contents of the variable.

      My point is that the ability to use the same variable name with a different sigil doesn't add any real value and only serves to make code more confusing, especially for neophytes. Even once you've mastered the quirky syntax, it still makes it harder to skim code (or to search it, for that matter).

    122. Re:Wait, what? by Wdomburg · · Score: 1

      I'm familiar with the hows and whys of sigils. I just think the combination of sigil variance and allowing the same identifier to be used for different types (i.e. both $foo and @foo) is particularly awful. Of course I think sigil variance is awful on it's own. :)

    123. Re:Wait, what? by dgatwood · · Score: 1

      PHP's preg_replace et al seem to fit the bill, but they have the advantage of not requiring an ugly, hard-to-parse blob of mess in the middle of your code (because PHP's regex engine uses normal strings to hold the pieces of the regex).

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    124. Re:Wait, what? by dgatwood · · Score: 1

      Partially Encrypted Regex Language?

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    125. Re:Wait, what? by flyingfsck · · Score: 1

      "I always saw those kind of symbols as reminders for the programmer"

      Just like the Microsoft long lost love affair with hUngarian nOtation, it produces unreadable code, with no actual advantage.

      (OK, I should now get an award for dragging mention of MS into a Perl discussion!)

      --
      Excuse me, but please get off my Pennisetum Clandestinum, eh!
    126. Re:Wait, what? by AuMatar · · Score: 1

      I'll say never. The slight advantage it can give you through not having to 0 base an array (for example you may want your calendar to be labeled days 1-31) is far offset by the loss of readability by anyone else who ever has to maintain your code, especially since not all of them will be perl masters.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    127. Re:Wait, what? by chromatic · · Score: 1

      Yes, you can override the index from which arrays are numbered.

      Not in a modern release of Perl (5.16).

    128. Re:Wait, what? by fahrbot-bot · · Score: 1

      One of Perl's biggest uses was web development.

      And (way) before that, its biggest use was - and is - for sysadmin administration tasks. From Wikipedia:

      Practical Extraction and Reporting Language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier.

      Perl gained widespread popularity in the late 1990s as a CGI scripting language, in part due to its parsing abilities.

      I used Perl in the '80s (yes, I'm old) for sysadmin tasks way before I used it for CGI and web-server tasks. I still use it everyday for commercial production sysadmin and programming projects on both Unix and Windows. (P.S. I've used Emacs since the '80s too.)

      I'll stack my productivity and code usefulness with these tools against any one/thing else, anyday...

      --
      It must have been something you assimilated. . . .
    129. Re:Wait, what? by fahrbot-bot · · Score: 1

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

      Though, for us Firefly fans, reliability is shiny.

      --
      It must have been something you assimilated. . . .
    130. Re:Wait, what? by synthespian · · Score: 1

      Exactly...WTF!
      Perl and Perl's hacker community, when you think about it, did amazing feats, bending Perl to take whatever shape they wanted/needed.
      People wanted OOP - Perl's closures allowed that. Perl's OOP is better than most would think. (Read: Object-Oriented Perl).
      Want to program in functional-style? They proved you could do a lot of FP stuff in Perl. (Read: Higher-Order Perl).
      They even went ahead and gave Perl a Meta-Object Protocol, sort of CLOS-style (CLOS = Common Lisp Object System, which some would argue is the most advanced out there).
      And Perl is pretty fast, when compared to Python or Ruby.With a huge number of libraries (CPAN).
      So Perl is pretty successful and has held its own as one very flexible language. The fact that the language did not change much, and yet achieved so much, is really a testament to its happy, fortuitous design.

      IMHO some mistakes were made in not supporting things that are not Perl per se, but would be crucial in a modern programming language:
      - Perl is a PITA for C-interoperability and a lot of Python these days is about, in fact, using a deeper C layer (why not more Lua, then?). C is crucial for speed (that means number-crunching and graphics), for software re-use, and its *the* lingua franca of software.
      - Some sort officially-sanctioned GUI should've been adopted. Again, this isn't Perl per se, but having mult-platform GUI support could've secured a better position at the desktop space (but most Perl people work at the data center/server level).

      And then there's Perl6...Perl6 was supposed to be great - its design is great - but IMHO the developers made the mistake of forgetting the lessons of the past, forsaking an advanced functional language for the implementation of complex language features - this despite Audrey Tang's effort - and then got caught in a labyrinth they can't get seem to get out of. And this move might have been caused by pure prejudice against Haskell or sheer stubborness, I don't know.

      Whatever the reasons (and to be fair, one got tired of following the slow progress of Perl6), letting Pugs die when Audrey had done so much by herself just didn't seem rational at all. Maybe it was, maybe it wasn't, but if the history of programming languages servers as a parameter, the odds were in favor of a Haskell (or SML, or Ocaml, etc.) implementation, because the advanced features Perl6 was aiming for, to my knowledge, were never decently implemented with the usual bag of C-oid tools (the olnly thing that comes to mind is Mathematica, which was very buggy in its initial version, when compared to Maple). Smalltalk, Lisp, etc. They all seem to built some sort of interpreter or language kernel and grow the language from there. It doesn't seem that was what the Perl6 implementors were doing. It's almost as if they were emulating the Java developers - and we know how long it took then to implement a modicum of advanced language features over there...

      --
      Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts
    131. Re:Wait, what? by Anonymous Coward · · Score: 0

      Right now, the best thing which could happen to Perl IMO is a fork of the Perl5.

      Like, say, Moe?

    132. Re:Wait, what? by VortexCortex · · Score: 1

      C/C++,

      How do you write in C/C++? Using the common subset of both? You might like to try C++, it's very nice.

      Allow me to interject. I too write in C/C++. Because C++'s name mangling is complier specific. To disable that feature we use the extern "C" { ... } block. Within that block of a C++ file is C code that won't be name-mangled. This is neccesary to write any library code that may be called by code written with a different compiler. Protip: C++ is basically a very fancy preprocessor for C. What you're referring to as C++ is really C/C++ or as I've recently taken to calling it: C plus C++

    133. Re:Wait, what? by chromatic · · Score: 1

      ... letting Pugs die when Audrey had done so much by herself just didn't seem rational at all.

      Pugs was almost entirely unmaintainable without Audrey. I stopped hacking on it when it took eight hours to run the test suite to verify the correctness of even a simple change.

    134. Re:Wait, what? by Will.Woodhull · · Score: 1

      I think it is legitimate to say that Perl 6 is moribund, if not dead. It has been 13 years since the announcement of its beginning, and there is still no first stable release in sight. I, for one, have given up on waiting for it. It had been 80% complete by about 2005, when Wall & Co were saying that they were deep into coding the second 80% of the project, but they seem to be stuck in the umpteenth iteration of that second 80%.

      Meanwhile, Perl v5.xx.yy (the version numbers have been getting stranger and weirder and yet even stranger than weird [this parenthetical phrase uses the same approach to describing modifications as the Perl versioning system]) is going strong. There have been several releases of subversions of subversions, or something like that. There are bug fixes and tweaks and it is well on the way to the v5.99.99 release. Perl v5.xx.yy is a mature and stable language capable of really elegant stuff when used by an adept programmer. Also capable of letting a code dabbling monkey make a real POS that for all its problems still does what he wanted it to do.

      Perl remains the best choice for gluing together workflows that involve manipulating arbitrary apps with different I-O formats, or for doing complex operations involving complex regular expressions. I doubt that there are many sysadmins who do not use Perl in some way in their dialy routines.

      To my mind, Perl's main weakness has been the way it implements OOP: its objects are blessed things that are different enough from C type objects or Javascript objects that I have trouble getting my head around all the implications. I think Perl's objects are probably a good thing, but I am not at all comfortable with them.

      --
      Will
    135. Re:Wait, what? by synthespian · · Score: 1

      When you say "Perl is scary" I take it you mean that you don't like TIMTOWDI.
      I have often pondered about this. It seems a simple design has its advantages - you quickly pick up the simple rules, and away you go. Now, there's an aspect of engineering. Java, Python, they might be better for the larger software houses, in the sense that they facilitate things for the "code monkey". There's nothing wrong with that job position, although the term is derrogatory. Eiffel, for example, is a well-designed language that takes that approach very explicitly (they even say there's no space for the "language guru" in Eiffel).
      But Perl is no more scary then C++. C++ is large, complex, full of hidden gotchas. That never stopped it from being used at a very large scale.
      I really feel most arguments against Perl are lazy and not well thought out.
      Let's say Perl is "complex", like, say Common Lisp is "large and complex". I tend to think these complex languages are the languages of the experts, the power-users. The language bend and twist to the expert's desires. This makes them achieve great productivity.
      The point being, there's a learning curve to Perl (not much, it takes reading the Camel book) and other "complex" languages, but there's a pot at the end of the rainbow in personal satisfaction and productivity.

      --
      Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts
    136. Re:Wait, what? by synthespian · · Score: 1

      Perl is not black magic. It just takes reading the Camel book.
      Now, if you don't, you will see consctructs that will make you go "Wow, how did he come up with that?!".
      Some people don't want to read...There's nothing Perl or Larry Wall can do about that...

      --
      Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts
    137. Re:Wait, what? by fahrbot-bot · · Score: 1

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

      If Perl isn't fast enough for you already, you need to cut back on the caffeine / amphetamines.
      I'm not sure Perl can be any faster for most uses.

      For example, I wrote a Perl script to display installed Solaris package information that runs faster than the native (compiled) utility. This script opens/reads/parses/displays 1500 files (each in a different folder) in 0.25s (1/4) where the native Solaris utility takes 7s (seven).

      --
      It must have been something you assimilated. . . .
    138. Re:Wait, what? by psmears · · Score: 1

      Yes, you can override the index from which arrays are numbered.

      Not in a modern release of Perl (5.16).

      It works there too. There's a warning about it being deprecated, but it still works.

    139. Re:Wait, what? by Anonymous Coward · · Score: 0

      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.

      If you use Perl enough, that one line of Perl code actually makes sense and is easily read and understood.

      You don't have to code like that. I used to write Perl code that looked like C code. But as I learned more Perl idioms and how they worked, it made more and more sense to use them. I use a lot of Perl one-liners when doing commands on a system, and over time I find that I can make those one-liners even smaller and I save the one-liners I come up with in a file with notes on how they work.

    140. Re:Wait, what? by Anonymous Coward · · Score: 0

      Well, since everything in Ruby is an object I guess that's semantically true. But with things like:

      some_variable.gsub(/regex/, string)

      some_variable =~ /regex/

      I don't see your "build a regex object" as true. There are built-in regex methods and operators. I made the switch to Ruby not because it was new, but because I just found it easier to "speak". I always felt like perl's OO was pasted on, where as Ruby is OO from the roots up. I was hoping that perl 6 would emerge and I'd be pulled back by it "just clicking" the way Ruby has for me. But that was years ago, and I'm glad I didn't wait around. At this point perl 6 just seems like a some academic exercise. Disclaimer, I stopped even paying attention to perl 6 many years ago. I think in any language the developers need to embrace evolution as much as support for past practice and code. In any platform, hardware, software, etc, to stop evolving is to stagnate. Much of the argument is "look how much perl is out there in use" but that could just be an indication that it's hanging around just because people don't want to switch, even if a better tool comes along. You have to ask; if you taught a group of students with no previous coding background both languages, would perl get chosen more than the other?

    141. Re:Wait, what? by Will.Woodhull · · Score: 1

      I agree with parent post.

      Except that I think it is unfair to use the same kind of benchmark with Perl as should be used on PHP, Javascript, or compiled languages where the performance of the final version is critical to the overall mission.

      Perl's great strength is in rapidly developing a prototype, possibly a one-off that will be tossed in the dust bin after its first successful run. An appropriate benchmark for the work that Perl is suited to is the length of the development phase: How many hours from when the need for the program is identified to when the first acceptable results are obtained? Typically Perl will get through the development phase in a fraction of the time needed to do it in any compiled language.

      After the prototype is working in Perl, then decisions about whether it should be migrated to some other language should be made. If the application is a batch process that will run at the end of each month, then it probably does not matter whether it takes 10 times as long to complete as the equivalent C program. Sometimes the prototype is good enough for production work.

      --
      Will
    142. Re:Wait, what? by nmr_andrew · · Score: 1
      Of course it has, and probably always will be. The problem as I see it with Perl 6 is that it has little resemblance to the Perl we know.

      Perl 5 was accepted quickly because it mostly fixed some issues and added features to Perl 4. Perl 6 changes everything.

    143. Re:Wait, what? by Anonymous Coward · · Score: 0

      "Okay, so Perl6 is not done yet, but when it is the bar for ...." That's some kind of Zen joke right? LOL I stopped believing it would ever be done a number of years ago. I'm wondering, by the time perl 6 is done will we even be programming computers anymore? "Slashdot.org, circa 2040 - perl 6 finally released!"

    144. Re:Wait, what? by Will.Woodhull · · Score: 1

      I believe it was about 5 years ago that Larry Wall said that the team had completed 80% of Perl v6, and were now making good progress on finishing the remaining 80%.

      But I think they have gotten stuck in a loop somewhere, because they seem to keep iterating through that last 80% year after year after year....

      --
      Will
    145. Re:Wait, what? by Will.Woodhull · · Score: 1

      The other official backronym is Perfectly Eclectic Rubbish Lister.

      --
      Will
    146. Re:Wait, what? by darkwing_bmf · · Score: 1

      TIOBE counts page hits, not page searches. Searching on a language will not make it go up in the list.

      That being said, out of curiosity, what intrigued you about Ada enough to do a search on it? And what made you decide that it wasn't for you?

    147. Re:Wait, what? by Xenna · · Score: 1

      Ultimately what killed it, and what launched PHP's rocket, was the ease with which the latter could be embedded in HTML code.

      It was possible to do that with Perl (Apache::Sandwich), but a bit of a hassle. PHP came standard enabled on most Linux distributions. All you had to do was create a .php file in the right place and you were in business.

      If the Perl guys had made that as effortless as with PHP, then Perl would've been the winner right now.

    148. Re:Wait, what? by Bogtha · · Score: 1

      Good for you. Perhaps with another couple of decades of using Perl, you can find a way of using it to read past the first line of the comments you reply to, or perhaps just comprehending the first line would be a good start.

      --
      Bogtha Bogtha Bogtha
    149. Re:Wait, what? by Xenna · · Score: 1

      "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"

      I know myriads of correct wa[y]s to implement solutions in any of the dozen languages I know. Are you saying you know only one?

      (this complaint about Perl has never failed to puzzle me)

    150. Re:Wait, what? by doom · · Score: 1

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

      You're not still using grep are you? I almost always use ack, myself. It is, of course, written in perl, and is up on CPAN.

      (It sure is weird that a "stagnant" language like perl has so much stuff going up on CPAN all the time.)

    151. Re:Wait, what? by VGPowerlord · · Score: 1

      Most of?
      This language is only a few years old. Perl is 20 and still works. In 20 years .NET code will be unusable. MS will have changed to something else.

      C# and .NET in general is 11 years old now and still being actively developed.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    152. Re:Wait, what? by Anonymous Coward · · Score: 0

      I'm pretty sure the P is for Pathologically. Also, little known fact: version 1 was called KNIT.

    153. Re:Wait, what? by h4rr4r · · Score: 1

      Perl is over 20. Perl5 and 6 are still being actively developed.

    154. Re:Wait, what? by doom · · Score: 1

      No, no perl is "failing" because the hype machine has moved on to other things. And that's happened because (a) the hype machine has to, it thrives on New New New, and (b) because there was a decade-long smear campaign against perl [1].

      By any sane measure of "success" perl was and is a great success. But don't let me get in the way of your consensus hallucination.

      [1] The CS geeks were insulted that Larry suggested they didn't know what they're doing, but really they didn't (e.g. see Pascal). Larry has since admitted that he didn't know what he was doing either. There's a lot of it going around.

    155. Re:Wait, what? by doom · · Score: 1

      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.

      Well, now that's certainly a nice story. It has no connection with reality, but what do you expect, we're just a bunch of programmers.

    156. Re:Wait, what? by jgrahn · · Score: 1

      ... 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.

      Makes sense. Shell scripts make better glue than Perl (or Python or anything else), and with bash you have a powerful and stable shell language.

      Perl is still the best sed/awk replacement though. I use it heavily, in standalone programs and as one-liners, for text processing.

    157. Re:Wait, what? by doom · · Score: 1

      (this complaint about Perl has never failed to puzzle me)

      Like most complaints about perl, this one is over-argued, but it gets closer to a real problem than most do. The lack of standardisation in the perl world means you need to think a little harder about some things-- you can download an "object oriented" package off of CPAN, but if you need to extend it with a sub-class, you've got to do a lot of poking around under the hood just to see how it's objects were implemented. And by the way, what calling context does it report errors in (does it die or croak), and does it return error objects or just strings? Oh, and if you need to crunch some XML, is there a way to do it in perl? Sure. Which way should you do it? Well.... how much time do you have?

      Myself I'm happy with (or at least resigned to) this state of affairs, and I look on it as the price of freedom. But the straight-jacket fetishists at least have a point that needs to be dealt with...

      (What I like is the same people who argue that "there should be just one way" also argue that you should learn lots of languages for the educational effect. Which is it, is mental exercise good or bad?)

    158. Re:Wait, what? by K.+S.+Kyosuke · · Score: 1

      Scripting languages...

      ...such as LuaJIT...

      ...are always, always vastly slower than compiled languages like C or Fortran. That's why they are often used as "glue" languages, and you never want to do big loopy things in them.

      Oops. You seem to have a problem with factual correctness right there.

      --
      Ezekiel 23:20
    159. Re:Wait, what? by Jherico · · Score: 1

      Defining and using the regex inline is a bug, not a feature. It typically means you're putting regex literals into the code, which is just as bad as peppering your code with hard-coded constants.

      --

      Jherico

      What can the average user can do to ensure his security? "Nothing, you're screwed"

    160. Re:Wait, what? by doom · · Score: 1

      print "Oh, give it a $expletive rest\n";

    161. Re:Wait, what? by Anonymous Coward · · Score: 0

      Protip: C++ is basically a very fancy preprocessor for C.

      Protip: you are basically a very fancy bullshit generator.

    162. Re:Wait, what? by gregor-e · · Score: 2

      I enjoyed lunch with Larry at OSCON in 2009. I asked when Perl 6 would be done, and he assured me it would be ready by Christmas.

    163. Re:Wait, what? by marklark · · Score: 1

      A little bit of troll food here: There is a roadmap and a vision for the future.

      Get informed/involved at perl.org

    164. Re:Wait, what? by gregor-e · · Score: 1

      Look at all that garbage...tsk...tsk...
      sub read_file { return map{my ($value, $key) = split "="; ($value => $key)} split '\n', do {local(*ARGV, $/) = [shift]; }; }

    165. Re:Wait, what? by gigaherz · · Score: 1

      Yes, most of -- this means . What has age to do with this? .NET 1.0 was released in 2002, and it was a very early version, nowhere close to being mature, so it had issues that needed fixing. v1.1 fixed a lot, but there were design flaws in the system that couldn't just be patched on top of the existing VM -- something that Sun/Oracle decided to do with Java, because god forbid making the new code not work in my old cellphone (although that finally happened in Java 7, IIRC).

      This is a guide to exactly what breaking changes were done between .NET 1.1 and 2.0: Breaking Changes in .NET Framework 2.0. Almost all the changes are either fixes for design flaws, or problems with the implementation that couldn't be fixed without breaking compatibility. So yes, MOST of the code works, and whatever code may not work, it's probably because it was using/abusing features that were broken.

      Also, Microsoft is just the main developer of the .NET technologies. If Microsoft decided to suddenly drop all support for .NET and stop all development, we could still continue to use it and work on improving the standard through the Mono project, some fork of Mono, or a whole new implementation.

    166. Re:Wait, what? by gigaherz · · Score: 1

      Whoops, sorry, pretend that "-- this means " is not there, I missed that bit.

    167. Re:Wait, what? by fahrbot-bot · · Score: 1

      No, I read your entire post; I just thought it was weak and naive.
      But to each their own youngster.

      --
      It must have been something you assimilated. . . .
    168. Re:Wait, what? by ThePhilips · · Score: 1

      I have read all the deltas from 5.8 to 5.14 (they are part of the Perl man pages) and there is really nothing major there. Tweaks and fixes here and there. Couple of syntax tweaks from Perl6. Multi-threading enhancements. But nothing what can potentially make Perl more relevant to me now.

      --
      All hope abandon ye who enter here.
    169. Re:Wait, what? by Anonymous Coward · · Score: 0

      The best thing about Python is that it DOESN'T use CPAN!

    170. Re:Wait, what? by hazah · · Score: 1

      Which one usually depends on the situation too. There isn't really a "one true way".

    171. Re:Wait, what? by Pseudonym · · Score: 1

      Protip: C++ is basically a very fancy preprocessor for C.

      Observation: No professional engineer has ever used the word "protip" non-ironically. I'm going to give you the benefit of the doubt and assume you're trying to be snarky and you don't actually believe it. Nonetheless, there are newbies among us, so the record has to be set straight.

      This is true in the same way that Ada is basically a fancy preprocessor for Pascal. Which is to say, it's true in the sense of having been almost true a long time ago, but today is completely untrue and extremely misleading.

      For the benefit of anyone who hasn't written anything nontrivial in C++ in the last decade (not that I think you all should have, of course), C++ is a very different language from C.

      FWIW, I used to think C++ was arcane, hard to understand, over-complicated and generally unnecessary. That was before I actually used it seriously. It's still not my favorite language, but for anyone who knows both, you can almost always get far more useful work done in C++ than in C.

      Having said all that, C++ can indeed be used as a better C. Sometimes (e.g. on microcontroller-sized platforms), it's even a pretty good idea.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    172. Re:Wait, what? by cats · · Score: 1

      Rsysc: What's your point?
      cats: FUCK YOU, that's my point!! You know why, Mister? 'Cause you coded a Hyundai to get here tonight, I wrote an 80,000 dollar BMW. That's my point!! (to gregor-e) And your point is "you're wanting". And you can't play in a man's game. You can't close them. (at a near whisper) Then go home home and tell your wife your troubles. (to everyone again) Because only one thing counts in this life! Get them to sign on the line, which is dotted! You hear me, you fuckin' faggots? (cats flips over a blackboard which has two sets of letters on it: ABC, and AIDA.) A-B-C. A-Always, B-Be, C-Coding. Always be coding! Always be coding! A-I-D-A. Attention, Interest, Decision, Action. Attention -- do I have your attention? Interest -- are you interested? I know you are 'cause it's fuck or walk. You code, or you hit the bricks! Decision -- have you made your decision for Christ?!! And action. A-I-D-A. Get out there!! You got the code specs coming in. You think they came in to get outta the rain? A guy don't walk on the lot lest he wants to buy. Sitting out there waiting to give you their money! Are you gonna take it? Are you man enough to take it?

    173. Re:Wait, what? by Schmorgluck · · Score: 1

      Bad example, this calendar stuff. I totally agree the gain in that case wouldn't be significant enough to justify using such a trick. I was more thinking of tight optimisation for handling huge datasets. My point still is: if you think of using this at some point, don't think twice, think thrice or more. There's almost always a less witchy solution. Almost.

      --
      There's nothing like $HOME
    174. Re:Wait, what? by Anonymous Coward · · Score: 0

      are you the asshole that wrote this code?

      static int kConstantOne = atoi("1");

      Did a hard-coded constant steal your girlfriend or something?

    175. Re:Wait, what? by Anonymous Coward · · Score: 0

      Perl!

    176. Re:Wait, what? by skids · · Score: 1

      You're seriously going to criticize the aesthtic of inline regex literals from the shakey ground of a language that couldn't figure out a better function name than "preg_replace"?

    177. Re:Wait, what? by skids · · Score: 1

      I hope you realize that's an in-joke among perl6'rs.

    178. Re:Wait, what? by skids · · Score: 1

      Given the support for Junctions, it should last into the first gen of quantum-assisted computers :)

    179. Re:Wait, what? by skids · · Score: 1

      Perl is only scary to those who have not practiced with it enough. Unless the author was trying to obfuscate or wasn't thinking clearly, those "line noise" scripts are actually easier to read than the equivalent 1000 lines of code distributed in 5 files that don't actually divide up functionality in any useful manner.

    180. Re:Wait, what? by DrVxD · · Score: 1

      My Perl solution returned results twice as fast (averaging 22ms/query) as any other in the class, most of which were C or C++

      That doesn't mean Perl is fast - it means your classmates were idiots.

      And it took me half the time to write.

      See above.

      --
      Not everything that can be measured matters; Not everything that matters can be measured.
    181. Re:Wait, what? by DrVxD · · Score: 1


      re.match('^[a-z]',inputline)

      Yes, I see how much overhead there is for 'building and using a regex object'.

      --
      Not everything that can be measured matters; Not everything that matters can be measured.
    182. Re:Wait, what? by skids · · Score: 1

      that bash is, for some reason, eating Perl's lunch in the sysadmin/code-glue areas

      What you are seeing here is init scripts gradually being expanded to include the functionality of tools written in Perl. There's a consitent inclination on the part of distros to include a minimalist set of core packages (despite the expanding size of installation media and system cababilities even on embedded systems). Bash serves as a lowest common denominator which, if the user base slogs away at it long enough, can be used to express the same functionality of utlities oriinally written in Perl, albeit somewhat less succinctly/maintainably.

    183. Re:Wait, what? by Anonymous Coward · · Score: 0

      That's utter nonsense. Perl's DBI modules are fantastic for DB access.

      Yes, DBI is good, but it doesn't stomp all over other languages in the same way Perl's text handling command set does. It's all relative.

    184. Re:Wait, what? by Anonymous Coward · · Score: 0

      From Learning Perl, 6th edition (15 years newer than the 2nd edition):

      What Does “Perl” Stand For?

      Perl is sometimes called the “Practical Extraction and Report Language,” although it
      has also been called a “Pathologically Eclectic Rubbish Lister,” among other expan-
      sions. It’s actually a backronym, not an acronym, since Larry Wall, Perl’s creator, came
      up with the name first and the expansion later. That’s why “Perl” isn’t in all caps.
      There’s no point in arguing which expansion is correct: Larry endorses both.

      You may also see “perl” with a lowercase p in some writing. In general, “Perl” with a
      capital P refers to the language and “perl” with a lowercase p refers to the actual inter-
      preter that compiles and runs your programs. In the house style, we write the names
      of programs like perl.

    185. Re:Wait, what? by garaged · · Score: 1

      I am a big fan of Perl, have used it for a lot of years, and find it useful most of the time, but if you have tried to install any complex app made in Perl you have noticed is damn hard, with the hell of dependencies, and specific library version requierements it can become impossible to install some really interesting tools (diaspora for one).

      Pretty much the same with small scripts, as soon as you start working on improvements by reusing libraries you find subtle undocumented API changes, and find yourself reading the source code to understand the phylosophy behind the implementation ending up in more wasted time that actually writing your own library.

      Perl rocks, but is not by far the most elegant language available right now.

      --
      I'm positive, don't belive me look at my karma
    186. Re:Wait, what? by garaged · · Score: 1

      Database was your bottleneck for sure, still, if C or C++ was slower those programmers were really lousy at the job

      --
      I'm positive, don't belive me look at my karma
    187. Re:Wait, what? by dgatwood · · Score: 1

      *shrugs*

      It's a lot easier to add a function with a different name that calls that function than it is to make Perl not look like line noise. :-)

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    188. Re:Wait, what? by Anonymous Coward · · Score: 0

      Was that back when Solaris was nicknamed Slowlaris?

    189. Re:Wait, what? by Forever+Wondering · · Score: 1

      You are so right. I benchmarked about 5 regex engines [a _long_ time ago], and at that time perl's engine was [minimum] 10x faster. If I get some spare time, I'll have to resurrect that benchmarker from the deep archive and run it again to see how the current competition stacks up.

      --
      Like a good neighbor, fsck is there ...
    190. Re:Wait, what? by Anonymous Coward · · Score: 0

      Well, yes, maybe he has completely mis-read the article, but he does have a good point about the current state of computing in general.

    191. Re:Wait, what? by samjam · · Score: 1

      Because at the beginning they needed cheap to develop and deploy, not fast.

      Only because they were successful at the beginning can they afford to buy "fast"

    192. Re:Wait, what? by YeeHaW_Jelte · · Score: 1

      "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."

      Yes, because somehow all of those PHP sites are running 'copy-pasted' code and all those Perl sites are running custom code ... you're clawing at straws here. These sites are using PHP because obviously it's the better choice. It's just as easy to 'copy-paste' a Perl CMS as a PHP CMS. However, nobody's doing that, judging by the numbers.

      And then again: 'copy-pasting' as you call it is a perfectly legitimate reuse of code. I'd rather call it installing a tried-and-proven system. Ever heard of DRY and not trying to reinvent the wheel?

      Regarding the unnoticed custom back-end stuff: PHP does fine on CLI. I've loads of PHP scripts running as cronjobs. BASH scripts as well. No Perl. Why not? Not because I can't program Perl, it's because the syntax is so head-splittingly different from the whole C family AND (here it comes) Perl has _absolutely_ no advantage over either PHP/CLI for database batch jobs and such or BASH for shell scripting. It might be faster than PHP, but on batch jobs involving large datasets your database is always going to be the bottleneck, so who cares?

      Perl has been at a standstill compared to PHP and other scripting languages. I know PHP is not very popular here on slashdot but it has made some pretty serious advances in the last few years. Decent frameworks like Zend, Symfony and Laravel have made develop very much quicker. Stuff like Doctrine and Propel ORM's have given PHP access to some pretty powerfull data modelling and storing/retrieving methods. Integration of Solr and Varnish have given it very fast searching and caching solutions. And finally, whilst PHP consistency in syntax still sucks (stuff like function arguments and naming are terrible) improvements to the OO capabilities in PHP5 have taken away a lot of the rough edges it once had.

      --

      ---
      "The chances of a demonic possession spreading are remote -- relax."
    193. Re:Wait, what? by Rysc · · Score: 1

      You could say the same thing about case-sensitive variables. The fact that you can use COLUMNS and columns in C and they mean different things is confusing, especially for neophytes! The VB solution of case insensitive names is obviously less confusing and thus superior, right? Why should anyone have to master this syntax quirk?

      The sigil is part of the variable name and makes the names different (and this is very clear). Most of the time you will also alter the variable names in other ways, because it's usually a good idea, but there is no problem with leaving the non-sigil part the same from a confusion point of view *when the code is clearer as a result*. Just as COLUMNS in C is *obviously* a constant to anyone familiar with C, and just as having a COLUMNS constant should not preclude me from having a local int columns; variable.

      --
      I want my Cowboyneal
    194. Re:Wait, what? by spiralx · · Score: 1

      If you're doing XML in Python use the lxml library, it's a wrapper around libxml2 and libxslt, and is a joy to use.

    195. Re:Wait, what? by cthulhu11 · · Score: 1

      ... only when tchrist writes it

    196. Re:Wait, what? by shaitand · · Score: 1

      My anecdotal experience (developing on systems doing millions of matches against complex expressions in a huge bank of patterns daily) indicate that the disparity is going in Perl's favor over time. And you need an optimization for your specific work case you might just find it is already there. I was thinking about building essentially the exact same functionality when I found the perl "study" function for instance.

      People think Perl is dead and static because it has been Perl 5 forever but Perl is anything but static. Perl 5 sees tons of development, not just bug fixes and optimizations but major functionality additions. I just updated my copy of the camel book which was two editions out of date. Both covered Perl 5 and it is just a new edition of the same book. But the book has tripled in size and most of the new features are only covered in light detail. Because Perl 6 has essentially been designed major functional improvements to the Perl 6 model are still just Perl 5 updates. For instance there has been a couple of major overhauls of perl threading all within Perl 5.

    197. Re:Wait, what? by Forever+Wondering · · Score: 1
      Hmm ...

      Using study in this way [along with threads] suggests you work for Yahoo [which used a lot of perl in the early days], or Google, or Ask. I've not used study personally [because I'm only applying a few regexs/line], but for "big data" searches, it can be a true win.

      I do, however, have a few programs that use threads. I wrote a [thin] layer above the threads to implement a boss/worker model easily and the programs implement a map/reduce-like operation. I used to have a script that did a "grep -r -l" and then vi'ed the resulting list. Now that same script uses perl regexes with multiple threads and feeds the final reduce list to vi. It's _much_ faster.

      I've been using perl since perl4 circa 1993 and I had about 250,000 lines of tcsh shell script, sed, awk, etc. I tossed that all away after I discovered perl and now have about 120,000 lines of perl (30% is comments/whitespace).

      One of the truly nice things about perl is that many of the features are grown "organically". That is, it wasn't like somebody said "Oh, the theoretical literature says that a modern language should have thus-n-such feature so let's add it" (e.g. the Gnome 3 model). Most of perl's features came out as solutions to practical problems. That's why it's comparatively lean-and-mean. The backported features of perl6 are an example of this. One of my [minor] peeves has always been the lack of switch/case functionality from C. With perl6's "given" having been backported into perl5, it takes away that issue.

      The people that find perl's syntax "scary" assume that they have to use the "scary" syntax. I'm also a C programmer, so most of my perl looks a lot like C. This is done intentionally as my style preference. I implement C structs as hashes: $x = {}; $x->{y} = 5; $x->{z} = 7; Everything is in a function of some kind. I do a C main function [renamed "master" to avoid confusion with perl's "main" package]. The first line of each of my perl programs [after use statements] is: "master(@ARGV);"

      But, I've also used many of perl's advanced features (classes, blessed references, etc.) at one time or another. perl allows filters to be tacked onto its interpreter so that input files can be filtered. This was originally done to implement the byteloader. I co-op'ed this to implement a filter that implements CPP-like functionality for my scripts. Perhaps not what the designers originally intended. When I first started using this in the 1990's it was undocumented [and I thought I was being really clever in figuring it out]. Now it's part of the standard perl docs.

      perl6 is no longer referred to as a [future] rev of perl5. It's now referred to as a "sister language". But, IIRC, the perl6 interpreter [when it finally gets finished], will be able to auto-detect perl5 or perl6 and allow one to intermix perl5 and perl6 from different files in one program. In short, perl5 isn't going away any time soon. The perl5 team will be maintaining/improving the perl5 interpreter for a long time after perl6 is truly deployed. In fact, the perl5 guys might just implement 100% of perl6 as extensions to perl5 because they got tired of waiting for the perl6 team to produce a robust interpreter :-)

      --
      Like a good neighbor, fsck is there ...
    198. Re:Wait, what? by akanouras · · Score: 1

      Either you directly translate it to Python:

      def read_file(filename):

          file = open(filename)
          lines = [line.rstrip('\r\n') for line in file]
          file.close()

          data = {}
          for line in lines:
              key, value = line.split('=')
              data[key] = value

          return data

      Or you don't:

      def read_file(filename):
          with open(filename) as file:
              return dict(line.rstrip('\r\n').split('=', 1) for line in file)

    199. Re:Wait, what? by Rysc · · Score: 1

      That said, I do feel that discrete names provide better clarity, and don't believe that having distinct symbol tables for each variable type is beneficial

      I do not disagree that for this example there are superior name choices that could have been used. I preferred not to dig through real code to find an example of a case where there was no better choice than to use the same basic name with different sigils; it does happen and it's not unclear.

      I think the guy who wrote the ruby version also understood what you were doing. His point (and mine, to a lesser degree) is that if you use distinct names, which he and I both appear to prefer, then the sigils become clutter.

      And my point is sigils are part of the name, which makes each name distinct.

      --
      I want my Cowboyneal
    200. Re:Wait, what? by Rysc · · Score: 1

      80% of the spec perhaps, now we're closer to 90% of the implementation. You can use almost all of it right now.

      --
      I want my Cowboyneal
    201. Re:Wait, what? by mooingyak · · Score: 1

      And my point is sigils are part of the name, which makes each name distinct.

      But they're not part of the name. To my original post on the subject:

      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?

      not to mention cases where you can have
      $foo, @foo, and %foo, and then assignments like:

      $foo = $foo[5];
      $foo = $foo{bar};

      which is a more common case than the one above

      The sigils tell you what type to expect an expression to return, but they're not part of the name.

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    202. Re:Wait, what? by Doc+Hopper · · Score: 1

      Also sigils are what make variable interpolation in strings possible...python must resort to sprintf-like formatting.
      $foo = 'scalar';
      print "foo is a $foo variable";
      vs
      foo = 'python'
      print "foo is a %s variable" % foo

      The Python example can also be written:
      foo = 'python'
      print('foo is a ' + foo + ' variable')

      You're right in that Perl provides much more compact nomenclature, but Python doesn't require sprintf-like syntax for the same output. Python's two possible approaches to this problem are very javascript-like.

    203. Re:Wait, what? by dolmen.fr · · Score: 1

      The only issue is that "basic regex power" is far behind. Every input is Unicode nowadays, and Perl still leads the way, in general unicode handling features, but also in handling unicode in regexes.

  2. Any talk along this vein by 93+Escort+Wagon · · Score: 1

    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?

    --
    #DeleteChrome
    1. Re:Any talk along this vein by prefec2 · · Score: 2

      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.

    2. Re:Any talk along this vein by 93+Escort+Wagon · · Score: 1

      Right, I agree with your assessment - however php's continual problems with security, coupled with the breathtakingly feature-complete security flaw recently seen in ruby on rails, highlights (to me, anyway) the fact that perl doesn't seem to have these additional problems "more modern" languages and development platforms include.

      --
      #DeleteChrome
  3. Still widely used for good reasons (and some bad) by eksith · · Score: 2
    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).

    --
    If computers were people, I'd be a misanthrope.
  4. Re:Still widely used for good reasons (and some ba by Viol8 · · Score: 3, Informative

    "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.

  5. So, in a few years time... by ebbe11 · · Score: 2

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

    --

    My opinion? See above.
    1. Re:So, in a few years time... by c0lo · · Score: 1

      Long live the LISP, king of parens

      --
      Questions raise, answers kill. Raise questions to stay alive.
    2. Re:So, in a few years time... by ColdCat · · Score: 1

      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.

    3. Re:So, in a few years time... by dingen · · Score: 1

      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.

      --
      Pretty good is actually pretty bad.
    4. Re:So, in a few years time... by PhilHibbs · · Score: 1

      Whoosh!

    5. Re:So, in a few years time... by Tridus · · Score: 1

      Woosh...

      --
      -- "So they told me that using the download page to download something was not something they anticipated." - Bill Gates
    6. Re:So, in a few years time... by bzipitidoo · · Score: 1

      Languages never die?

      Where's ALGOL? The last time it was updated was, what, 1968? Still sort of living as shell script, perhaps? How about Pascal and Modula? PL/1? Where's classic BASIC with line numbering, like GW-BASIC, not this VB bastardization? I'm sure all these are still lurking about on a few legacy systems, but that's not alive. Undead perhaps, but not alive.

      --
      Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
  6. Perl for sysadmins by Krneki · · Score: 1

    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?

    --
    Love many, trust a few, do harm to none.
    1. Re:Perl for sysadmins by guacamole · · Score: 5, Interesting

      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

      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.

    2. Re:Perl for sysadmins by Anonymous Coward · · Score: 0

      It's the bomb try it.

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

    3. Re:Perl for sysadmins by mvdwege · · Score: 1

      What's wrong with the proposed solutions? If you want to do serious programming and you don't understand how closures work, you have no business behind a keyboard.

      About the worst I can say is that the sigils and braces make the Perl code look ugly. I can live with that.

      --
      "I know I will be modded down for this": where's the option '-1, Asking for it'?
    4. Re:Perl for sysadmins by Rufty · · Score: 1

      By the time a shell command get roughly to "find -xdev .... -print0 | xargs -0 awk ...." its time for a short shell script. When the shell script evolves roughly to the point of needing arrays, well time for perl. And by the time the perl script needs graphical output or objects - python. (Or that much under used scripting cruncher, octave.)

      --
      Red to red, black to black. Switch it on, but stand well back.
    5. Re:Perl for sysadmins by happy_place · · Score: 1

      Perl's a great choice for sysadmins, especially Linux. It's extremely popular among sysadmins. Perl didn't get popular because of sysadmin, it's never lost that following, that's the de facto standard language for tying all shells and tools together as a sysadmin in Unix based operating systems.

      If you stay entirely in windows, you'll probably want to head in the direction of a microsoft-only language, just because you'll probably get more help in administering your system if you are familiar with their languages... I've seen a lot of Visual Basic in Windows-only sysadmin tasks.

      There are other considerations as well. For example, I understand that many newer mobile OS's like android use python for many of their sysadmin tasks and developer tools, so it may be advisable to consider as well. Python's quite popular in unix-based operating systems as well, but not in Windows.

      Good luck...

      --
      http://www.beanleafpress.com
    6. Re:Perl for sysadmins by Seb+C. · · Score: 1

      Shell script is ok for one liner, and so is awk.
      But still, if I need to really write a batch that is more or less complex, i'd immediately switch to perl : shell forks too much (unless you're only using builtin, but then you have to know which commands are builtin and which aren't. And yes, using system command or forking in perl is just non-sense (and mainly used because of misknowledge of perl capability).

    7. Re:Perl for sysadmins by Anonymous Coward · · Score: 0

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

      In my opinion, Perl is still the best tool. It's the logical evolution of Bash - still easy to learn, still quick to write - but with oh so much more power.

      The nearest equivalent is command line PHP, and command line PHP is horrible.

      Python and Ruby have gained some traction among the trendy, but Ruby and Python don't bring anything of real value to the table in terms of general purpose tools.

      That said - you should at least learn about Ruby and Python, simply because trendy fools will and you might encounter their crap if you ever switch jobs/need a shiny new analytics package/whatever. But no, don't give up your Perl. There's no valid reason to do so.

    8. Re:Perl for sysadmins by Anonymous Coward · · Score: 0

      The last big Perl flame post I think poster vlm said it best:

      I'm a CPAN programmer.

    9. Re:Perl for sysadmins by shaitand · · Score: 1

      Yup and the same for many text mangling tasks involving a regex. The typical unix pipeline tools used to outperform perl for this stuff but now perl often greps faster than grep.

    10. Re:Perl for sysadmins by Anonymous Coward · · Score: 0

      Perl is certainly right for sysadmins.
      [SNIP]
      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

      Speaking for sysadmins everywhere, CPAN is a no-go. We don't have Internet access from every system, and there is no Java jar analog for packaging a Perl program and dependencies.

      A structured zip file like jar, or even just a simple executable directory structure like what OS X has would go a LOOOOOOOOONG ways towards bringing CPAN modules to the thickest part of the Perl user community, sysadmins.

    11. Re:Perl for sysadmins by shaitand · · Score: 1

      First of all, a lack of braces makes code much more difficult to follow. That equates to ugly in my mind. The other thing people harp on are the magic variables in Perl. Seriously, there are only a half dozen in common usage. I think most of the people harping on Perl don't like that you need to know Perl to read Perl (or to write it correctly). It isn't a language that lends itself well to sitting down with a reference and applying your C knowledge. Well written Perl is certainly quite readable for a Perl programmer.

    12. Re:Perl for sysadmins by shaitand · · Score: 1

      Perl is definitely still the right solution. Python is something made by people who don't know Perl and think they know what code should look like. So they made a language that offers no benefits over Perl and has enforced white space. If you already properly indent your code there is really nothing to be gained using Python and Python isn't as well suited as Perl to many tasks. Python doesn't have anything has comprehensive as CPAN... no other language does. There are CPAN like solutions out there but they aren't anywhere near as comprehensive.

    13. Re:Perl for sysadmins by guacamole · · Score: 1

      I understand closures. In fact, you can do pretty much anything you can think of in Perl. If Python didn't exist, I guess we could still accomplish a lot with Perl.

      The issue with readability and style. Look at the abundance of special characters sprinkled in the Perl code, the increased verbosity, as well as the need to understand its idiosyncratic rules, specially with respect to using references or interpreting function parameters, since Perl lacks formal named function parameters. The funny thing about Perl is that code relies on too many implicit rules (e.g. what's in @_ or $_, whether we have array or scalar context, etc) and on too many things that have to be spelled out explicitly (my for lexical scope, references for accessing nested data structure, treating function parameters explicitly as @_ array)

      I like the simpler philosophy of Lisps where you can nest any data structure inside another data structure without using any references explicitly. Python follows this philosophy too. Python also uses formal function parameters, as most other languages do, but also allows them to be passed by name and without the formal order, or even omitted if there is a default value (as in GNU R). Again, you can accomplish the same tasks in Perl, but it looks too verbose, too explicit, and strangely too implicit at the same time.

    14. Re:Perl for sysadmins by mvdwege · · Score: 1

      All your arguments boil down to aesthetics. There is nothing wrong with that, just say you dislike the look of Perl code and be done with that.

      The minute you start looking for technical excuses though, is the moment your argument falls through. Really, complaining about sigils in Perl, and then comparing against Lisp with its masses of parentheses and use of sigils to, among others, indicate function objects? Not to mention all the special globals you can set in the Lisp interpreter?

      The only real technical point I am willing to give you is the use of references in data structures. There is an inherent ugliness in using them, and a possibility for confusion especially with arrays.

      --
      "I know I will be modded down for this": where's the option '-1, Asking for it'?
  7. Re:Still widely used for good reasons (and some ba by Jahta · · Score: 1

    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 sounds a great idea, but for code people depend on, consistency matters more.

  8. Re:Still widely used for good reasons (and some ba by girlintraining · · Score: 0

    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.

    --
    #fuckbeta #iamslashdot #dicemustdie
  9. awk? by tgv · · Score: 1

    With a bit of luck, awk will outlive perl.

    1. Re:awk? by Anonymous Coward · · Score: 0

      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.

    2. Re:awk? by guacamole · · Score: 1

      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/

    3. Re:awk? by tgv · · Score: 1

      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.

    4. Re:awk? by tgv · · Score: 1

      Ok, that should have been: while (<file1> && &ltfile2>)

    5. Re:awk? by tgv · · Score: 1

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

    6. Re:awk? by guacamole · · Score: 2

      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.

    7. Re:awk? by dingen · · Score: 1

      It's so much cleaner than perl

      Wow, EVEN cleaner than Perl. Who thought it possible?

      --
      Pretty good is actually pretty bad.
    8. Re:awk? by jones_supa · · Score: 1

      A small fix still needed. You probably meant:

      (<file1> && <file2>)

    9. Re:awk? by tgv · · Score: 1

      True dat. But in those cases, Perl should be used like awk: only for short scripts, preferably things that fit on the command line. As soon as a perl (or awk) scripts exceeds 99 lines, it should probably be rewritten...

    10. Re:awk? by dingen · · Score: 1

      Luckily one could write an entire operating system in 99 lines of Perl!

      --
      Pretty good is actually pretty bad.
    11. Re:awk? by shaitand · · Score: 1

      "Perl should be used like awk: only for short scripts, preferably things that fit on the command line. As soon as a perl (or awk) scripts exceeds 99 lines, it should probably be rewritten..."

      Any particular reason why? Well written modern Perl is fast, clean, time tested, reliable, and easy to write. Is there some reason you should avoid it?

    12. Re:awk? by shaitand · · Score: 1

      " I remember writing a Perl script that had to do some kind of diff between two files and wondering why the following line failed"

      That would be a reflection on your lack of knowing Perl and not a reflection on the language.
       

    13. Re:awk? by tgv · · Score: 1

      No. The language was, possibly still is, a badly defined mess. It's fine to write while (<file1>), right? It's fine to write while (a && b), right? But it's not fine to use two handles with a logical in a while test. Why? Just because. And there's a lot more like that. The language design was sloppy. Like placing parentheses around an expression doesn't alter its value. Except in Perl when the context asks for a scalar, if I remember properly. And the parameter mechanism, another obnoxious hack. And all these $, %, # and whatever else the ascii table offers.

    14. Re:awk? by shaitand · · Score: 1

      "No. The language was, possibly still is, a badly defined mess."

      No, you just don't know Perl.

      "It's fine to write while (<file1>), right? It's fine to write while (a && b), right?"

      Yes to the first and no to the second. It would result in an error about bare words I believe. Anyone who ever wrote any Perl, and I'm talking a single afternoon farting around with online tutorial, would know that. At least it does if you use strict and warnings, I couldn't tell you what it does without because I always use strict and warnings. You do use strict and use warnings, right?

      "But it's not fine to use two handles with a logical in a while test."

      It is perfectly fine. It seems likely that you, in your ignorance, assumed that one of the filehandle lines would be automatically assigned to $_ when in reality you are using them for a comparison and throwing them away. Relying on $_ is bad form and leads to hard to read and understand code and things breaking in strange places. What you probably wanted was while(<FILEA> && defined(my $line = <FILEB>)) or maybe while(defined(my $linea = <FILEA>) && defined(my $lineb = <FILEB>)).

      "Like placing parentheses around an expression doesn't alter its value"

      Huh? Unless you mean for order of operations purposes where it certainly does have an impact in Perl you must just be nitpicking about syntax style. Just like you do when you complain about Perl making use of many symbols. There is no such thing as a correct syntax style provided it is functional and consistent which Perl's certainly is. You are asserting a pure aesthetic preference as if it were the way things should be (or shouldn't be in this case). You sound like a Pythonite.

    15. Re:awk? by Anonymous Coward · · Score: 0

      Thanks!

  10. Re:Still widely used for good reasons (and some ba by I_Wrote_This · · Score: 0

    ....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.

  11. What is Perl? by prefec2 · · Score: 4, Insightful

    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.

    1. Re:What is Perl? by guacamole · · Score: 3, Insightful

      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.

    2. Re:What is Perl? by Anonymous Coward · · Score: 0

      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.)

    3. Re:What is Perl? by Anonymous Coward · · Score: 0

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

      take that, slashcode!

    4. Re:What is Perl? by Anonymous Coward · · Score: 0

      Totally correct. Python is a language that's bad at everything. By working on making it fast for GUI apps, it's got slower startup times for scripts. You can't win them all. Reminds me of Java that way. Java is actually a good language for server side applications, but it's terrible for desktop apps and even worse for browsers. Python folks should focus on their strengths. They want to be the GUI language for gnome, fine. Don't bother with web apps and fast cron jobs.

    5. Re:What is Perl? by takshaka · · Score: 1

      The first Perl enemy was PHP. While PHP sucks in many ways, it was better designed to write simple dynamic web pages.

      mod_php installed on every virtual hosting provider is the main reason the language took off. Had mod_perl been a safe alternative in a multi-user environment, much of today's PHP marketshare would be eaten up by frameworks like Mason.

    6. Re:What is Perl? by Anonymous Coward · · Score: 0

      What's your point? Python looks like an alien language to people who are not familiar with the Latin alphabet.

      Besides, what sane programmer would use a language that relies on whitespace for syntax? (spoiler: No sane programmer would. Only programmers who have decided to rationalize their insanity!)

    7. Re:What is Perl? by jameshofo · · Score: 1

      Perl can do web Like CGI math system admin Perl has syntax rules, but it doesn't limit you to an imaginary box, that's its power, and some would suggest its flaw.

      --
      Good leaders run toward problems, bad leaders hide from them.
    8. Re:What is Perl? by taoboy · · Score: 1

      Hmm... I thought Perl was C with nicer data types, or bash with nicer conditionals. That it does sed and awk things is just gravy.

      I usually think of Perl as that multi-purpose knife in the bottom of the tool box; not a 'proper' tool per se, but so useful when the other tools don't have that particular pointy-thing that fits in the torx screw or a scoopy-thing that happens to gouge more fittingly than the fancy chisel.

      I learn new languages when I have a particular problem to solve. I learned Perl way back for such a reason. I later looked at Python, but I didn't have a problem handy that wasn't more expediently solved with Perl. Too bad I learned Perl first...

      If Firefox had a Perl interpreter, I wouldn't be jacking around with this javascript crap right now...

    9. Re:What is Perl? by shaitand · · Score: 1

      "I thought Perl was C with nicer data types, or bash with nicer conditionals"

      That's cool but if you implement execution and control structures the same way in Perl that you do in C they aren't going to give very good performance. You don't want to be spending much time monkeying with arrays in Perl for example.

    10. Re:What is Perl? by shaitand · · Score: 1

      "For custom application or other mostly larger system Java-based or .NET-based technologies are used."

      Perl is actually still used extensively in this space.

      "As the Unix command shell is only a limited realm (in number of installations)"

      Yeah, hardly any *nix deployments in the world. Sounds like you work in an isolated area of the market filled with windows shops.

    11. Re:What is Perl? by Anonymous Coward · · Score: 0

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

      slashdot is perl.

    12. Re:What is Perl? by petit_robert · · Score: 1

      some people seem to get plenty of good performance :

      http://www.gossamer-threads.com/lists/modperl/modperl/104941

    13. Re:What is Perl? by wkcole · · Score: 1

      Perl is a historically a combination of bash, awk and sed.

      There's the first clue that this is a troll. Perl was devised to replace the model of using a Unix shell to wire together bits of sed and awk, but the shells that informed the creation of Perl through v4 cannot have included bash unless Larry Wall has a time machine. There's certainly some sh influence in Perl and maybe csh as well, although one could believe that the influence was a desire to redeem the idea of a C/sh hybrid from the mutant horror of csh.

      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.

      Um, yeah... because apps like Slash, RT, and Movable Type are really large and frameworks like Mason and Catalyst are overkill for anything modest. Or maybe I am reading you wrong?

      More directly: It is absolutely true that a lot of sysadmins use Perl as a shell alternative for text processing and that it has its roots in that problem space. However, it also was the overwhelmingly dominant language for web application development for many years and its extension to that job largely defined the functional space for what a web application language has to do. Perl is a procedural language from its roots, but it also has a mature object implementation and a rich universe of modules using it that include multiple frameworks for web applications. IMHO most of the perception of Perl as less "suited" for web development is a result of the diversity of Perl code aimed at the web. There isn't an obvious single stack of Perl modules to use as a basis for all web apps (i.e. an analog to Rails) but rather a bazaar of options that make sense for different sorts of app. It is certainly NOT suited to casual amateur web development.

      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.

      Not really "better" but rather "only," at least in its origins. It is inevitable that a language created to be web-specific at a time when most web development was done in languages designed for more generalized use (e.g. Perl) would be better fit to that specific purpose, at least in the most trivial ways. It certainly makes PHP more accessible for low-skill coders, a fact demonstrated by the unending stream of fundamentally simple security problems in widely-deployed PHP code.

      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.

      Yes, PHP has largely soaked up the pool of interest of casual code tweakers and it is much easier to offer commodity-grade hosting with credible PHP functionality than it is to do the same for any other language/platform. That was arguably true for FrontPage some years back and we all know how it managed to take over the world.

      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?

      There is more diversity in large-scale and custom enterprise web applications than you admit. In many cases big Perl systems have not lost their jobs, they've just matured and stabilized. Movable Type is a great example: it is still the engine behind a lot of very large websites but it has lost buzz to weaker platforms over the

    14. Re:What is Perl? by Anonymous Coward · · Score: 0

      Yes, PHP has largely soaked up the pool of interest of casual code tweakers and it is much easier to offer commodity-grade hosting with credible PHP functionality than it is to do the same for any other language/platform. That was arguably true for FrontPage some years back and we all know how it managed to take over the world.

      Wow. I had completely blocked out that FrontPage ever existed. Thanks for reviving a decade-old nightmare.

  12. Re:Perl's gory days are behind by Let's+All+Be+Chinese · · Score: 1

    Whadayamean, "mis"read?

    Oh, in the literal sense.

    Then again, this is Paul Venezia, a hack columnist who forgot an "off" somewhere.

  13. Re:Still widely used for good reasons (and some ba by Anonymous Coward · · Score: 3, Informative

    No. Just no.

  14. Industry bias against getting results by Anonymous Coward · · Score: 0

    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.

    1. Re:Industry bias against getting results by vlm · · Score: 1

      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.

      --
      "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
  15. Re:Still widely used for good reasons (and some ba by guacamole · · Score: 2

    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.

  16. Re:Still widely used for good reasons (and some ba by Anonymous Coward · · Score: 0

    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?

  17. Re:Still widely used for good reasons (and some ba by Volguus+Zildrohar · · Score: 1

    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.

    --
    When confronted with one problem, some think "I'll use recursion". Now they are confronted with one problem.
  18. Perl's a mess by fyngyrz · · Score: 1

    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.

    --
    I've fallen off your lawn, and I can't get up.
    1. Re:Perl's a mess by vlm · · Score: 3, Informative

      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

      $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.

      --
      "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
    2. Re:Perl's a mess by Anonymous Coward · · Score: 1

      "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.

    3. Re:Perl's a mess by Lisandro · · Score: 2

      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.)

      I love Python and use it daily, but there's one area where it lacks: speed. Perl is, by far, one of the fastest languages i've used and a very good choice if you're doing heavy batch processing.

    4. Re:Perl's a mess by Anonymous Coward · · Score: 0

      I write a good amount of Perl. When I need to do serious number crunching I still use Perl! That is I use PDL.
      PDL is a fantastic replacement for Matlab and Octave. Especially in those situations where you have part of the project already written in Perl.

    5. Re:Perl's a mess by synthespian · · Score: 1

      The problem is that people look at Perl - without having learned it - and say "unreadable!"
      That really is the kind of circular thought only stupid people can achieve - "I dunno Perl, so I can't read Perl, so I don't know Perl, so I think it's unreadable (...)"
      Now, anybody seriously considering reading large arrays into Perl can ask the Bioinformatic guys how Perl is cutting it for them, or also choose to use the Perl Data Language which seems good enough for some guys in an Astrophysics department.

      --
      Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts
    6. Re:Perl's a mess by doom · · Score: 1

      The problem is that people look at Perl - without having learned it - and say "unreadable!"

      There's different theories about where the "unreadable" meme comes from. A lot of it has to do with regular expression integration, but then as Larry Wall has pointed out, everyone seems to be trying to imitate perl 5 regular expressions, so: "Go figure."

      (And perl 5's regexp implementation is actually really fast and has more features than it's competitors... but whatever, us supremely rational software engineers only care about technical advantages on alternate Tuesdays.)

    7. Re:Perl's a mess by Anonymous Coward · · Score: 0

      Right speed.

      So why not program in assembler?

    8. Re:Perl's a mess by maxwell+demon · · Score: 1

      Right speed.

      So why not program in assembler?

      Portability.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    9. Re:Perl's a mess by fyngyrz · · Score: 1

      lol.... did you even look at the example code you pointed to? Crap, what an unholy mess!

      Please. Perl's got hacks that sorta act like multi dim array if you jump through hoops. But they aren't really that, and they don't actually work like multi dim arrays, and it's a bloody mess if you're even willing to be slightly honest. Half the time the thing presents as a single dim array anyway.

      --
      I've fallen off your lawn, and I can't get up.
    10. Re:Perl's a mess by Raenex · · Score: 1

      The problem is that people look at Perl - without having learned it - and say "unreadable!"

      The problem is even people who have learned Perl find it unreadable. Sigil hell.

    11. Re:Perl's a mess by petermgreen · · Score: 1

      Unless you are using them day in day out regexes have a habbit of looking very much like line noise.

      By putting regexes into the language at syntax level (rather than merely as a library function) they elevated it's status and encourage people to turn to it first. IMO the questions of "should regexes be used as the default way of solving matching/parsing problems" and "what format is best when you do need a regex" are orthogonal questions.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  19. Re:Still widely used for good reasons (and some ba by Anonymous Coward · · Score: 1

    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.

  20. TMTOWTDI (There's more than one way to do it), by MrKaos · · Score: 1, Insightful

    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.

    --
    My ism, it's full of beliefs.
    1. Re:TMTOWTDI (There's more than one way to do it), by Anonymous Coward · · Score: 0

      ...the opinion I got from many management types were Perl was just a little too clever.

      Simple addition is too clever for your average management type.

    2. Re:TMTOWTDI (There's more than one way to do it), by MrKaos · · Score: 1

      ...the opinion I got from many management types were Perl was just a little too clever.

      Simple addition is too clever for your average management type.

      However, good management allows you to focus on the problems at hand while they deal with the organisational politics and procedural issues that stop you from getting anything done.

      --
      My ism, it's full of beliefs.
    3. Re:TMTOWTDI (There's more than one way to do it), by Hognoxious · · Score: 1

      I like Perl, I'm just not very good at its subtilties yet

      Perl doesn't have them, but it should.

      Like with a foreign film, it might be understandable if there was a translation below.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  21. You can write... by fyngyrz · · Score: 1

    ...darn near anything 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.

    --
    I've fallen off your lawn, and I can't get up.
    1. Re:You can write... by shaitand · · Score: 1

      You can write darn near anything in anything. But there aren't many problems that Python is well suited to that Perl isn't better suited to.

  22. Not for long: Python convert here. by Anonymous Coward · · Score: 0

    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.

    1. Re:Not for long: Python convert here. by h4rr4r · · Score: 1

      Python needs to be forked to ignore whitespace. Indentation is style not meaning.

      Also this only one way to do anything culture is braindead.

    2. Re:Not for long: Python convert here. by Anonymous Coward · · Score: 0

      I shouldn't feed you, but...
      Spoken like someone who has never had to maintain someone else's code.
      If you enjoy writing incomprehensible gibberish to make yourself feel 31447, then by all means continue to use Perl. The rest of us will be sure not to hire you. Maybe you can find a time machine and go back to the late 90's I hear Perl is really making headway at Pets.com

    3. Re:Not for long: Python convert here. by Anonymous Coward · · Score: 0

      If you enjoy writing incomprehensible gibberish to make yourself feel 31447,

      ELAAT? perhaps you meant 31337. :)

    4. Re:Not for long: Python convert here. by Anonymous Coward · · Score: 0

      Python needs to be forked to ignore whitespace. Indentation is style not meaning.

      Also this only one way to do anything culture is braindead.

      I disagree with both your points.

      Neither of which you actually cite any support for.

    5. Re:Not for long: Python convert here. by maxwell+demon · · Score: 1

      Spoken like someone who has never had to maintain someone else's code.

      What's wrong with just running it through an automatic indentation program?

      --
      The Tao of math: The numbers you can count are not the real numbers.
  23. I think it was important when Larry asked... by MrKaos · · Score: 1

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

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

    --
    My ism, it's full of beliefs.
    1. Re:I think it was important when Larry asked... by MrKaos · · Score: 1
      echo "WHOOOOOOSH" | banner

      Where the hell have all the geeks and nerds gone? Maybe it is all over for Perl.

      --
      My ism, it's full of beliefs.
    2. Re:I think it was important when Larry asked... by Anonymous Coward · · Score: 0
    3. Re:I think it was important when Larry asked... by Chrisq · · Score: 1

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

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

      I would be worried if it were

      s/d?{4}$/f$1/

    4. Re:I think it was important when Larry asked... by MrKaos · · Score: 1

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

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

      I would be worried if it were

      s/d?{4}$/f$1/

      you'd be quite restrained.

      --
      My ism, it's full of beliefs.
    5. Re:I think it was important when Larry asked... by Chrisq · · Score: 1

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

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

      I would be worried if it were

      s/d?{4}$/f$1/

      you'd be quite restrained.

      That's what worries me!

  24. Normal evolution by darkat · · Score: 1

    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.

  25. Dude. by Anonymous Coward · · Score: 0

    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.

    1. Re:Dude. by Rysc · · Score: 1

      PHP may be more actively hacked on than perl5, though I doubt it, but it cannot be called better. All the flaws of perl5, and many flaws from perl4, are present in PHP, along with a bunch of other problems.

      Perl5 OO is not so much "bolted on" as "Nonexistent"--instead it has a mechanism for designing your own OO system, which is great except that most people just want to get things done and don't care about being an architect at that level. These days it's a bit better in that you can tell any new person "Don't read perltoot, just use Moose" and they'll be a lot less frustrated and get more things done.

      --
      I want my Cowboyneal
    2. Re:Dude. by Indigo · · Score: 1

      Perl5 OO is not so much "bolted on" as "Nonexistent"--instead it has a mechanism for designing your own OO system, which is great except that most people just want to get things done and don't care about being an architect at that level.

      Yeah. Just like C++.

  26. Re:Still widely used for good reasons (and some ba by Anonymous Coward · · Score: 0

    Really? Python after Ruby? Ruby is a couple years newer than Python, and Python has been popular for much longer than Ruby.

  27. Indeed by Anonymous Coward · · Score: 1

    Perl is a very nice piece of engineering and a good programmer will instinctively love it for that. I am using it to to quickly build validation code for checking the output of a C++ data analysis program. Plus, I use it to instrument the C++ code for memory leak detection. Works much better than Purify, because the C++ program runs at nearly normal speed in memory leak detection.

    I once interviewed with a small company who develop and sell an ERP system. They use C++ for the core stuff and allow customers to extend/modify the system using Perl. They said their system is much leaner than the competition in terms of hardware requirements.

    Regarding the "unreadable" argument, that is 99% bullshit - it is up to the programmer to use the strict Perl modes and to use a proper coding style to create readable code. Just use explicit variables with proper names, for starters. Use a more verbose style and so on.

    Perl is indeed a perl of the software engineering community and I will take it over resource-devouring monstrosities like Java any day. I bet it will be around in 2100, when the crapper languages like PHP and Ruby have faded away.

    1. Re:Indeed by flyingfsck · · Score: 1

      Yup, when I write Perl, it ends up looking almost exactly, but not quite unlike C. Someone that can make a mess in Perl, can make a mess in any language.

      --
      Excuse me, but please get off my Pennisetum Clandestinum, eh!
  28. Re:Still widely used for good reasons (and some ba by Anonymous Coward · · Score: 0

    I wouldn't be so proud. Python's OO system is Perl's OO system.

  29. In my view Perl's greatest success was by Chrisq · · Score: 1

    In my view Perl's greatest success was its influence on other languages. Its pattern matching capabilities are a key part of Python, Ruby, and more and are even bolted on to Java. Perl may be on the very slow decline but the best bits are still increasingly in use

  30. Won't miss it by Coisiche · · Score: 1

    My exposure to Perl was inheriting the maintenance of a utility written in it after the original developer left the company I was at. That lasted a few years and also went through a few functional enhancement requests from the users until I too moved on; so I'd say I was reasonably adept with Perl.

    However, despite it being quite handy for some things, I never felt the inclination to use Perl for something developed from scratch. Even something that would have aligned well with Perl's strengths. I just didn't like it.

  31. Those are called sigils. by kleinesRaedchen · · Score: 2

    By separating variables to a namespace new keywords could be introduced anytime. Just try this in a language without sigils. So, it's a cool feature guaranteeing compatibility of nowadays Perl scripts with Perl interpreters in 3012.

    1. Re:Those are called sigils. by asshole+felcher · · Score: 1

      open(this_is_a_perl_3012_keyword, 'oops.text');

    2. Re:Those are called sigils. by kleinesRaedchen · · Score: 1

      you got me on this one ... I wanted to reply that the Perl interpreter (with warnings enabled) would happily warn about it. But then I performed a short test: "this_is_a_perl_3012_keyword" doesn't trigger a warning, neither do "thisisaperl3012keyword" nor "this_is_a_perl_keyword" whereas "thisisaperlkeyword" does. Seems to be some weird promise: Perl keywords will never contain underscores or digits. Another distinction mechanism, hooray!

  32. C must be dying too... by Dystopian+Rebel · · Score: 1

    ... except that it's not, despite several similar obituaries having been published.

    With all due respect to "language companies" and all the script kiddies coming out of universities today, C and Perl are the stable tools. They will remain important for any work requiring stability.

    Most "alternative" languages mentioned in this discussion have broken backwards compatibility at least once, have serious performance and other internal problems, and don't come close to the practical effectiveness of C and Perl.

    Perl 6 is a new language. I have played with it and I think it is evolving with the right principles.

    The next big challenge to serious programmers is concurrency. Functional programming is the only solution, but let's acknowledge that functional programming is nowhere near becoming the norm. It's very difficult to master, especially for OOP-damaged, pattern-deranged programmers and their IDEs of Desperation.

    Having said all this, I'll add that tools will change. Fads come and go, but the tools that do the real work in the most efficient way are always at the top of a smart coder's tool box. Including a Fad Detector.

    --
    Rich And Stupid is not so bad as Working For Rich And Stupid.
  33. The real problem: hiring by oneiros27 · · Score: 1

    Just as with COBOL and Fortran, with the language being less popular, it's more difficult to find people who really know the language, so that they can maintain and develop existing systems.

    Most of the people with strong knowledge aren't looking for new work. Those who still know Perl 4 are around, as are inexperienced folks who can write C in Perl. (you know the type -- using

    for ( my $i=0; $i++; $i < $max) { ... }

    vs.

    for my $i ( 0 .. $max-1 ) { ... }

    or delaring and initializing every damned variable on its own line. Or keeping 4 parallel arrays around, when an array of hashes or array of arrays would make the code easier to work with. Ie, not knowing the shortcuts & efficiencies of a given language).

    Some of what's in the perl 5 planning have me genuinely excited (see Jesse Vincent's many talks on the future of perl) ... perl 6 is a good idea, but the focus on was like Netscape deciding to rewrite Navigator from the ground up ... so much momentum was lost. We'll be better off when it's finally done, but the energy might've been better spent elsewhere.

    --
    Build it, and they will come^Hplain.
  34. They're Sigils NOT Variable types (Re:Wait, what?) by happy_place · · Score: 1

    A variable's type and variable sigils are not the same thing. The sigils help create context for the data operations that will occur. an @ tells the interpreter to prepare for list context, while $ tells the interpreter to prepare scalar context. Arguably one of the nicest contexts in Perl is the Hash (known as associative arrays in PHP, and sometimes called dictionaries in other lingos) context, which uses the sigil %.

    When you mix contexts from variables, you actually perform operations, because in Perl no symbol is merely a decoration, they are operators--including sigils. This shorthandish sort of approach has enabled the Perl language to really master data manipulation. You can treat a hash like a list, using hash slices, or take scalar context of a list and Perl will return the list size.

    Ironically, I find Perl to be one of the most consistent and deep languages available and in use these days.

    The problem with Perl is that it is its own language and programmers are lazy and want to program in languages that force them to do a lot of unnecessary busy-work not because they like it, but because that's what they've been taught to do. Managers are even lazier, and everyone wants to be able to understand your code, even if they haven't actually taken the time to learn the language.

    Learning Perl is a great way to improve your own coding approach, even if you don't use the language regularly, because it opens the mind to possibilities.

    --
    http://www.beanleafpress.com
  35. Re:Still widely used for good reasons (and some ba by ThePhilips · · Score: 1

    It's not about OO or syntax.

    Unlike Perl, Python simply has more up-to-date feature set. And better support for Windows.

    For example. Literally everything uses Unicode/utf-8 now - but Perl still defaults to binary/ASCII for everything. And Python defaults to utf-8 for the text.

    That's how it happens. 10-15 years ago, Perl was 100% useful out of the box. Now you have to pile up some options just to make it realize the default encoding of you environment. Inevitably, to spare the nonsense, one starts using the new tools - like Python - which are more in line with the current defaults.

    --
    All hope abandon ye who enter here.
  36. Guess What ? by TTL0 · · Score: 1

    Articles about Perl's demise aren't going anywhere either.

    --
    Sanity is the trademark of a weak mind. -- Mark Harrold
  37. More Articles to Come by TTL0 · · Score: 1

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

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

    Technology moves forward and life goes on. It does not mean something was the wrong tool at the time.

    --
    Sanity is the trademark of a weak mind. -- Mark Harrold
  38. Re:Still widely used for good reasons (and some ba by h4rr4r · · Score: 1

    Simplicity and Readability?

    You mean interpreting whitespace and a culture of know nothings that think only having one way to do a task is a good thing. A pox on your house.

  39. Language Design by YojimboJango · · Score: 5, Interesting

    I wrote this a while ago, but I find it's useful to post it here:

    The precondition that you can write terrible code in any language is a mental diversion. You must design languages for people that believe in intelligent design.
    If there is low hanging fruit in your garden of eden, people are going to assume that someone vastly smarter then they are placed it there for plucking.
    Not even God himself coming down from on high and face to face telling every member of the human race not to touch it is going to keep it from being abused.
    That is the true nature of humanity and by inclusion programmers.

    perl: An unorganized, but sprawling garden full of almost every imaginable fruit. Regex is a shiny sinful apple at eye level on every single tree. The only way to navigate the garden is to ask the snakes.
    python: An organized garden that has one of each kind of fruit. But it's half way through being dug up and replanted into an even more organized garden.
    ruby: A newer garden. Heaps of fertilizer make everything grow incredibly fast, but the trees are getting tangled and there's a problem with weeds.
    c#: Someone spent a lot of money crafting this garden correctly. They also planted trees that emit a hypnotic pollen that will murder you if you try to leave the garden.
    java: A beautiful garden but only when viewed from space. Every tree has exactly 1 fruit, and getting anywhere takes forever. Recently taken over by someone interested in c#'s hypnotic pollen trees.
    c++: An industrial farm complete with tractors and combine harvesters, but no safety equipment. As a bonus 98% of the farm does not contain buried land mines.
    c: A plot of land and a barn full of seeds. Get to work.
    javascript: There's only 1 tree and it grows upside down, but you can find it resurfacing in all the other gardens. It's also sentient, growing rapidly, and trying to murder you.

    1. Re:Language Design by cpghost · · Score: 2

      Beautiful garden analogies. I'm wondering what CommonLisp, Scheme and Prolog would be like. Or even ML and Haskell if you're truly masochistic.

      --
      cpghost at Cordula's Web.
    2. Re:Language Design by YojimboJango · · Score: 1

      I'd write analogies for those if I had expirence with them. The only one on that list that I have any hands on expirence with is Haskell and that was only in acedamia :P

  40. Perl was the only option for too long... by Above · · Score: 1

    I agree, and in fact find its "decline" natural and healthy. Perl was the only option for many things for too long, and so it was used. It may not have been the best option, but it worked. Since then the world has developed better options for certain applications, like Ruby or Python. As a result Perl is no longer used for some classes of applications, but that's a good thing. It keeps the language from being pushed and morphed in bad ways to solve non-core problems. While in absolute terms Perl may have "shrunk", the result is a strong, vibrant core of things it's good at, and a developer community focused on those things.

  41. Experts who think 1990's Perl is today's Perl by Anonymous Coward · · Score: 0

    I love reading all the comments from people who see perl written in the 1990s and believe that Modern Perl is the same.

    I love how all the other popular scripting languages claim they invented X, when Perl had it years and decades prior.

    I love how people claim that Perl isn't good to create a small website, when Dancer does this extremely well and easily.

    I've created a CRUD website in 4 lines of easily understood Perl-Dancer code.

    Modern Perl isn't the crap that everyone remembers. It is elegant, fast, pretty, and light on system resources. It lets you do complex things too and it lets you break rules if you need to.

    Doesn't that stuff matter anymore?

    I use the right tool for the job and very often Modern Perl is still the right tool, though I will use Ruby for toy websites and python when I pick up someone elses script.

    If I'm creating a toy or extremely complex program, Perl is my tool of choice. It fits and it gets the job done. It also pays very well, if you are skilled.

    1. Re:Experts who think 1990's Perl is today's Perl by Anonymous Coward · · Score: 0

      I love how fanboys turn red and flail their arms.

    2. Re:Experts who think 1990's Perl is today's Perl by DCFusor · · Score: 1
      Mod parent up. And hey guys, as an old fart developer who does it all, I love perl for where it fits - which turns out to be a surprisingly large number of places. Use the right tool for the job - that's the rule. You want windows-only blinding-fast, static linked, self installing GUI apps? Use C++/MFC, screw .net for almost anything, it's a wannabe language. You gotta go really fast and do funny things to tons of numbers - you might dip into assembly. You wanna write your own hard-deadline realtime opsys? You're going to wind up with asm and C. You want fast cgi that is reliable and catches all the edge cases? Perl, no question at all there. Ducktape? Perl. Cross platform gui apps? Perl + gtk, with the xml for the gui after the __END__ tag, all in one file.

      You need a small time script to collect data from your USB device (it's code was in C), then plot it in 4 dimensions in gnuplot? Perl. There are certain advantages to having the interpreter written together with the language, which is why perl kicks java around the block, speedwise, but not everything has to be super fast. At least perl doesn't go off on demented errands of its own at unpredictable times like java does. I'd guess most of us older guys thought that java was a joke - since it seemed bad C programmers couldn't stop leaking memory or using dangling pointers, java makes it all a reference. If you don't get that joke, you're not a real programmer.

      Example 4d plot - this code is only a few very readable pages (and it's free to download on my site) since you can code in perl to make it look very C like and readable. It took entire hours to write, most of that figuring out gnuplot's strangenesses. http://www.youtube.com/watch?v=WJe0YBAXwPw The gui, not shown in this movie is pretty simple, but allows you to put in perl code (presets are saved) into edit boxes for axis mapping - you can paste an entire program in there if you want to do something really complex. And it managed to run on that much data in a fraction of a second while using the slow eval string 4 times per loop iteration on the raw input.

      This would have taken a week in C (to write)...PHP? Does it do hardware, like finding USB stuff by-id?

      --
      Why guess when you can know? Measure!
  42. stagnation can be beneficial by CaptainNerdCave · · Score: 2

    A few years ago, I started trying to learn Ruby, but I quickly changed my mind because the project at large kept changing, and I didn't have time to follow it. Perl's stagnation has made it much easier to use as a resource in places where stability is key.

    Why is Perl great? Very small foot-print, minimal resources for outstanding performance, and flexibility.

    After abandoning Ruby (until they calm down), I started exploring Perl and C/C++ with much better results. In my experience, Perl can be very user-friendly, or it can be cryptic... just like most other languages.

  43. Re:Perl's gory days are behind by TimeandMaterials · · Score: 1

    :) Perl will be around for decades...just like Cobol.

  44. Perl is Beautiful. by happy_place · · Score: 1

    I use Python (and C, C++, C#, Java, etc), but love Perl.
    It allows me to be as eloquent or dilinquent as I want to be.
    If I want to blast out a concept, nothing gets there faster than Perl.
    Learning Idiomatic Perl requires a shift in the way one approaches programming. To do it well, it does require learning Perl from a Perl-perspective, and I think that's where most new programmers stumble. They want a C-based language that won't require them to change how they think about programming code--because they all code in C even when they're using Java, or Python.

    C programmers can program Perl too, of course... (that's how I started). Perl allows that, but you'll never really touch its brilliance if you stick to that approach. A great way to get started learning it is to find a community like http://perlmonks.org/ and start reading and posting questions about how to approach problems with a Perl-brain, rather than a C(Python, Java, whatever)-brain.

    I believe doing so will actually make you a better C(Python, Java, whatever) programmer as well...

    --
    http://www.beanleafpress.com
    1. Re:Perl is Beautiful. by shaitand · · Score: 1

      "To do it well, it does require learning Perl from a Perl-perspective."

      Absolutely. Actually that is one of Perl's weaknesses in my mind because you can do most things in a C like way and the end result will be functional but slow code. This leads many programmers who feel that you should be able to pick up any language in a day if you know how to program to think they know Perl and know that Perl is slow.

  45. This is just the trends talking. by concealment · · Score: 0

    Right now, we're in a bubble of web trends. This will not last, because people are realizing that (a) web programming isn't rocket science and (b) most people need modifications of existing off-the-shelf blogs, CMSs, etc. and not much else.

    The rare site that does require hardcore programming is more likely to use a language like Perl because it's more stable than the newer, trendier alternatives, and is more favorable to those with a classic CS education.

    The trendy people want us to think that Perl is dying, but the converse is true: the trends are dying, and they're trying to improve their own position by denigrating otherwise great languages.

    1. Re:This is just the trends talking. by shaitand · · Score: 1

      That and Perl isn't really a web programming language.

  46. Re:Perl's gory days are behind by Anonymous Coward · · Score: 0

    I read it as "glory hole days".

  47. once and future Perl by Anonymous Coward · · Score: 0

    Weird how Perl has completely disappeared from the web hardly anyone uses it maybe for old slow rickety web sites no one uses anymore that are constantly down like Craigslist and whatnot

    1. Re:once and future Perl by hughbar · · Score: 1

      Except, Amazon, the BBC [less than before, admittedly], Booking.com, Zoopla, Lovefilm.com for examplem all huge sites. I've worked for most of those too as a freelance. Don't blame the language for badly written code either. Actually, it's the one language I find incredibly intuitive because of the linguistics ideas and TMTOWTDI meaning that one can code around 'stuckage' and 'suckage'. Also CPAN is messy sometimes but awesome in terms of productivity and 'things that needn't be coded'.

      Go Perl!

      --
      On y va, qui mal y pense!
    2. Re:once and future Perl by shaitand · · Score: 1

      You seem to have this odd idea that Perl is a web related language.

    3. Re:once and future Perl by Anonymous Coward · · Score: 0

      Weird how Perl has completely disappeared from the web

      Just because you don't see a ".pl" at the end of the url doesn't mean that Perl isn't involved...

  48. Not on my machine! by water-and-sewer · · Score: 1

    Funny I should read this article just before ssh'ing into a server to write a little clean-up script. Guess what I used? Perl.

    It might be fading, there may be newer languages doing more magnificent things. But today Perl is all I needed to do what I needed to do, and that script will now run nightly until the server falls into the sun ... so goodbye and thanks for all the fish.

    --
    If this were Usenet, I'd killfile the lot of you.
  49. Re:Still widely used for good reasons (and some ba by Rhys · · Score: 1

    That's fine, it means while your snake charmer is out sick someone else can come in and actually fix (rather than introduce new) bugs.

    I've come in to real, live perl that glues together millions of dollars worth of data processing and it was not easy to understand and update. I didn't botch the changes I had to make, more thanks to good testing on my part than the quality and readability of the perl.

    Good luck doing that when your perl wizard gets a pox on his house.

    --
    Slashdot Patriotism: We Support our Dupes!
  50. Re:Still widely used for good reasons (and some ba by Anonymous Coward · · Score: 0

    It's not (just) about OO...

    You're right...OO is not the end-all be-all of programming...it's also about proper closures and the ability to do functional programming almost as easily as LISP. I'm sticking w/Perl.

  51. Why I still use Perl by KeithH · · Score: 3, Informative

    In a nutshell, I still use Perl heavily because I get paid to produce software - mostly embedded realtime telecom s/w but also a lot of tools as well. Pragmatism dictates that I use the tools with which I am proficient and which are universally available. Twenty years ago, I had to use Bourne shell more than I liked because I could only count on the availability of /bin/sh. Now, I have the luxury of being able to expect /bin/perl (version 5 no less). This counts for a lot in an environment where my hundreds of colleagues and I use hundreds of different servers with different operating systems, distributions, versions, and architectures. Yes, there is a lot to complain about with Perl but at the end of the day, Perl is still an excellent tool for many many problems and won't disappear from industrial applications any time soon.

  52. Regexes one-liners have wide language support by DragonWriter · · Score: 1

    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.

    Actually, plenty of other languages have language-level RegEx literals and either match operators or string methods that match against them, and don't require separate "creation" and "test" statements to match a string against a regex. JavaScript and Ruby come immediately to mind.

    And plenty that don't have regex literals as a language features can still do one-line define+test using their standard library (e.g., Python). So, no, it doesn't take more lines in other languages.

  53. FUD by shaitand · · Score: 1

    First Perl isn't declining in popularity, it just isn't growing. It is PERCEIVED to be declining but that has been the case for years. If anything I'm seeing more interest in Perl. I know I've seen more Perl related Slashdot stories in the past couple months than in the last few years.

    I'm curious what exactly you would replace Perl with? PHP? Only if you wrongly thought Perl was about web stuff. Python? ewww.. that's disgusting!

  54. Parent is confused by DragonWriter · · Score: 1

    Interpreted languages in general are old, and increasingly less useful.

    Python can be either interpreted or compiled. As is the case with most languages. Interpreted/compiled is a feature of implementations, not languages, and even in implementations isn't really a bright-line distinction.

    Javascript is transforming from an interpreted language into a compilation target due to its integration with web technologies

    You can't transform from "an interpreted language" to "a compilation target", because whether or not a language is implemented via an interpreter is orthogonal to whether or not some other language is compiled to it.

    Python is just python.

    This is not true except in the trivial sense in which it is true of every language, including JavaScript.

    Jython was a thing for a while, but it's not functional-language enough to handle new virtual and cloud infrastructures, where an app has to run on thousands of machines, scaling up to thousands more in response to load, all without operator intervention.

    Google would probably be surprised to learn that Python can't handle that use case, which is the prime use case for AppEngine.

    Languages that are not legacy compile to JVM, CLR and/or Javascript - Clojure, CoffeeScript, Opa.

    So, also, Python (JVM and CLR via Jython and IronPython), Ruby (JVM, CLR, and JavaScript via JRuby, IronRuby, Opal/HotRuby/Ruby2js), etc.?

    1. Re:Parent is confused by SoupIsGood+Food · · Score: 1

      What serious database (sql speaking or not) or operating system is written in a "non-legacy" language?

      A few of them were written in ADA, FORTRTAN and COBOL. These are clearly non-legacy languages, and the engine that powers the bold new ideas of industry and computer science.

      No seriously, it's all old shit, and anything remotely interesting is happening at a higher level these days. Sorry. Even app programming is being abstracted with stuff like Cordova. There are a lot of job openings, as operating systems and RDBMS's dating from the 70's need updating on occasion, so they've got that going on at least.

      Python can be either interpreted or compiled.

      No-one uses it compiled anymore for new projects. Hence legacy.

      You can't transform from "an interpreted language" to "a compilation target"

      Of course you can. You're arguing a point of semantics no-one in industry accepts as valid.

      Google would probably be surprised to learn that Python can't handle that use case

      No they wouldn't. They invented Go and Dart because Python can't handle that use case.

      So, also, Python (JVM and CLR via Jython and IronPython), Ruby (JVM, CLR, and JavaScript via JRuby, IronRuby, Opal/HotRuby/Ruby2js), etc.?

      That's cute - but no. Legacy languages with bolt-ons few people use. Time marches on, and in another ten years you'll be mocking all the Clojure and Node.js guys wondering where their glory has gone.

    2. Re:Parent is confused by DragonWriter · · Score: 1

      Python can be either interpreted or compiled. No-one uses it compiled anymore for new projects.

      Perhaps no one you know.

      Hence legacy.

      No, legacy would be "no one uses it at all for new projects", not "no one uses it compiled for new projects". But its not either. (It may be legacy in a specific organization that has adopted a policy that all new development will be in some other language, but that's true of any language, whether its old or a relatively new popular language that happens to have fallen out of favor at the particular organization.)

      You can't transform from "an interpreted language" to "a compilation target" Of course you can.

      No, you can't, because the two aren't opposed. You can be both together. Becoming the latter doesn't stop you from being the former.

      You're arguing a point of semantics no-one in industry accepts as valid.

      I think pretty much everyone I know in the industry recognizes whether or not something is a compilation target is orthogonal to whether or not it is, itself, an interpreted language.

      Google would probably be surprised to learn that Python can't handle that use case No they wouldn't. They invented Go and Dart because Python can't handle that use case.

      While Dart is usable on the back-end (and that's important, because a big part of its motivation is to have a front-and-back-end language), its main motivation is dealing with issues with JavaScript in the browser for large applications, not dealing with problems with Python as an application language for scalable web services.

      And Go is a lower-level system language for scalable services, not really comparable at the same level as Python. Its not motivated to deal with problems with Python.

      So, also, Python (JVM and CLR via Jython and IronPython), Ruby (JVM, CLR, and JavaScript via JRuby, IronRuby, Opal/HotRuby/Ruby2js), etc.? That's cute - but no. Legacy languages with bolt-ons few people use.

      Most of those aren't "bolt ons", they are language implementations. And, while some of them aren't widely used, some of them are (particularly JRuby.)

  55. @rE:%wAit, $wHat? by flyingfsck · · Score: 1

    yEah, bUt aLl tHose dAmn fUnny cHaracters rEak oF hUngarian sYntax, wHich i fInd eXtremely aNnoying tOo.

    --
    Excuse me, but please get off my Pennisetum Clandestinum, eh!
  56. Re:Still widely used for good reasons (and some ba by WaffleMonster · · Score: 1

    "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.

    Python and Perl were both released in the late 80's. It is now 2013. As far back as I can remember from the mid 90's people were making these same arguments for Python being more readable and OOIsh. CS departments even then were pushing Python while ignoring perl.

    Did something meaningful between Perl and Python change recently or are these essentially the same observations and arguments from 20 years ago?

  57. My .02 cents... as a former perl guy... by Mysticalfruit · · Score: 1

    So for approximately 10 years I did an IT job that involved 50% writing new perl to do ETL operations and 50% sorting out other peoples perl programs and fixing the bugs / extending the functionality.

    What I learned was that it's possible to write perl that's ultra compact, very efficient and utterly utterly unreadable. On more than one occasion I was presented with perl programs that were so utterly incomprehensible that my only solution was to discard the whole damn thing and write it all over again.

    Doing crap like constructing SQL statements by pushing and popping pieces of text onto $_, while possibly efficient, make modification nearly impossible and the code incomprehensible. You know you've written bad code when a year later when presented with the same piece of code you can't comprehend what it does.

    I'm not even going to start my diatribe regarding perl's horrifying bolt on object model!

    Five years ago I changed jobs and was nominally forced to use python. I was specifically told "You can write your tools in any language you like, as long as the output is python..." Initially I was skeptical but decided to dive in. Many of the ETL tools I'd written in the past I decided to rewrite in python so I'd have some perspective and it's night and day. The object model is cleaner, the syntax makes more sense (getting used to the indent syntax took getting used to, but you deal)

    While I'm not entirely convinced that python is the answer to every answer, I'm pretty convinced at this point that perl is NOT the answer. At least to any question I've had to ask lately.

    With that all said, to each their own. I've met and for a while was a person who could write really clean modular perl code. However for all the perl I ever saw in the wild, I was an anomaly.

    Conversely, As I've dug deeper into my job I'm yet to discover a piece of python that wasn't immediately readable and without some study wasn't understandable.

    I've even seen some of the code that the EVE online people have made publicly available and it's just readable.

    --
    Yes Francis, the world has gone crazy.
    1. Re:My .02 cents... as a former perl guy... by bzipitidoo · · Score: 1

      If you think Perl's OOP is bad, look at JavaScript. In JavaScript, an object is really a hash with some window dressing. It doesn't distinguish well between inheritance and containment. Further, JavaScript hashes are quite limited. Unlike Perl, there is no built in way to iterate over all the keys, get their names, or even check how many there are. Admittedly, C++ can't do that either-- heck C++ doesn't even have a native hash data type, have to dig into the STL for that. But C++ has the excuse that it is a compiled language.

      --
      Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
    2. Re:My .02 cents... as a former perl guy... by spiralx · · Score: 1

      Apart from Object.keys(obj) and obj.length that is.

    3. Re:My .02 cents... as a former perl guy... by bzipitidoo · · Score: 1

      Huh, I need more current documentation. I've been using the JavaScript Bible, 7th edition, and it doesn't mention Object.keys anywhere. Checking, I find that Object.keys() was introduced in JavaScript version 1.8.5, which came out in 2010, about the same time that book was released. Oldest version of Firefox that supports that is version 4.

      --
      Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
    4. Re:My .02 cents... as a former perl guy... by spiralx · · Score: 1

      To be fair there's been a lot of new stuff introduced from 1.8 onwards as part of ECMAScript 5, which do address a lot of the shortcomings of the language, including a lot of object changes - properties and descriptors, frozen objects, Object.getOwnPropertyNames etc. Development is proceeding rapidly after a long period of stasis.

  58. Re:Still widely used for good reasons (and some ba by kthreadd · · Score: 1

    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.

    Indeed, and if you still don't like the syntax then MooseX::Declare is there to save you.

  59. Re:Still widely used for good reasons (and some ba by synthespian · · Score: 1

    So Smalltalk is not OOP, right?

    --
    Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts
  60. True: it's an everything language. by concealment · · Score: 1

    Perl isn't really a web programming language.

    What exactly is a "web programming language"? Something that can spit out HTML, I imagine. Perl does that with the best of them and, since it is a general-purpose language, it does it exceptionally well.

    1. Re:True: it's an everything language. by shaitand · · Score: 1

      There are no shortage of purpose built languages that were designed for a specific purpose. Javascript is a web language, PHP is a web language. These languages were designed for web content and that is what they are primarily used for. They can be used for other things but you are using a tool for something other than it's designed purpose.

      Perl's intention is not a particular purpose at all but to work like real language in the sense that the meaning of elements within the language is context related and not static regardless of context.

      "people are realizing that (a) web programming isn't rocket science and (b) most people need modifications of existing"

      Doesn't have much relevance to Perl or whether Perl is suddenly going to die as Perl is not about web programming. That is only one of many many things that people have used Perl for. I think you'll find that most serious Perl programmers weren't really thrilled about dealing with hobbyist web programmers when it was the popular choice to fill this hole.

  61. MS-Access? by Tablizer · · Score: 1

    There's still an unfilled need for an OSS MS-Access-like product. O.O.Base still sucks (even more than Access).

  62. Perl for math by Anonymous Coward · · Score: 0

    If you really want to do massive math work in Perl, have a look at PDL. It started out in astronomy, but didn't stay there. Quite similar to IDL, I've been told.

  63. How a Language Dies... by Tablizer · · Score: 1

    Once a language is not perceived as "in", its growth flat-lines and then it slowly sinks on the popularity charts. It has happened to almost every "past" language* and will probably happen to the "in" languages like Ruby.

    * Except perhaps Lisp. It's still a niche favorite because of its flexible syntax and constructs.

  64. Re:Still widely used for good reasons (and some ba by Anonymous Coward · · Score: 0

    Have a look at http://moose.perl.org/ - it ain't your grandaddy's Perl.

    Compare this simple Python class with the equivalent post-modern Perl

    package OurClass;
    use Moose;
    has ‘arg1’ => (
            is => ‘rw’
    );
    has ‘arg2’ => (
            is => ‘rw’
    );
    sub printargs {
            my $self = shift;
            say $self->arg1;
            say $self->arg2;
    }
    no Moose;

  65. Incorrect; Google does NOT do Java by tlambert · · Score: 1

    Official languages are:

    - C/C++, considered one language
    - Python
    - JavaScript
    - Go, or whatever the internally developed flavor of the month is

    If you are going to try to target your skills, stick to the first three.

    1. Re:Incorrect; Google does NOT do Java by aled · · Score: 1

      since when? gmail was said to be in java and google has many open source java tools like gwt, guava and others.

      --

      "I think this line is mostly filler"
  66. You appear to be demanding elaboration... by tlambert · · Score: 1

    "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"

    I know myriads of correct wa[y]s to implement solutions in any of the dozen languages I know. Are you saying you know only one?

    (this complaint about Perl has never failed to puzzle me)

    Here are the attributes of a language which are the most important in a commercial environment:

    o Long term maintainability
    o Ease of debugging
    o Ability to replace one programmer with another when the first one is hit by a bus
    o Ability to replace one programmer with another halfway through a project when the first's skills are strongly needed elsewhere
    o Rapidity of development

    Perl is only a win on the last one. This has its place in business:

    o Creation of throw-away scripts which will be used once to bootstrap
    o Creation of very small scripts for data crunching/analysis; small is eventually understandable
    o Creation of prototypes for the purposes of obtaining initial funding (I'd argue Perl is not the best choice here, but it's viable)

    The commonality of all these things is that they are effective when you need a "Mr. Right Now"; when you need a "Mr. Right", then they lose their value. In the interesting case, which is the last one (the other two cases can be handled in any language by any code monkey, and can be thrown away and rewritten id the current implementation is too dense), that's good enough for angel funding. But if you are going for first round funding, there are other things which the investors are going to value more, and that goes back to the first list:

    o If six months in the main prima donna throws a hissy fit and leaves, will it be possible to continue?
    o If six months in, we have to replace parts of the team because they are not product focussed, will it be possible to continue?
    o If the plane crashes on the way to a trade show taking 3 people with it, will it be possible to continue?
    o If it's necessary to liquidate the startups assets in order to recoup investment, will there be any value in them to others?
    o If we need to scale rapidly without incurring huge hardware/rack rental/power expense, can we switch to a compiled language?
    o If we need to bring in a lot of new coders to achieve scale, while they be able to communicate effectively?

    For Perl code, the general answer to these questions is almost uniformly "no", unless you have an extraordinarily disciplined Perl programmer in the first place - in which case, you'd probably be using a more disciplined language. The answer to the last one, even if an extraordinarily disciplined programmer were able to answer "yes" to the other items, has to be a qualified "no", unless you have a readily available (read: not willing to pay above average market rate) talent pool from which to obtain more extraordinarily disciplines Perl programmers.

    Perl programmers rarely work in teams; when they do, it's almost unheard of them to work in teams on the same code base -- instead, they interface between chunks of code using system interfaces, rather than perl interfaces.

    It's OK to find joy in side effects, and it's OK to find joy in being able to go years without having to invoke system(3) using the same syntax/coding pattern, but in doing do, realize you are only finding joy for yourself, not your employer.

    Like I said originally: as long as CPAN is healthy, it's a good canary for Perl; I don't think the language is going away. But I still disagree with the OP as to why the metrics indicate that it's falling into disuse: it has nothing to due with the rapidity of releases or the rapidity of churn in language features, and everything to do with other intrinsic factors which are not as controllable as those.

  67. Re:Still widely used for good reasons (and some ba by guacamole · · Score: 1

    I don't think anything meaningful has changed. Sure both languages have been updated. Python 3 is an improvement over Python 2. New Perl modules let you access an improved object system and features backported from Perl 6. Still, Perl remains great for writing short powerful disposable scripts in short time. Python is more suitable for writing large applications. Python is used for teaching computer science because of its dead simple syntax rules so that instructors can concentrate on teaching algorithms and concepts instead of programming language idiosyncrasies.

  68. Perl failed because it's not free software by Anonymous Coward · · Score: 0

    When choosing a programming language, which inevitably requires a high level of commitment, serious developers and contributors take licensing freedom into consideration. Perl's artsy-fartsy license is not copyfree, and much of CPAN is downright GPL. This gave perl's competitors a definite advantage (especially after Ruby switched to BSD). Why marry a language that comes bundled with legal threats, that you can't embed into your app, and that will require hours of legal study to figure out what else you cannot do?

    FreeBSD was right to boot perl out of their base system, and I'm looking forward to when other UNIXen will do the same.

    --libman

  69. Re:Still widely used for good reasons (and some ba by DrVxD · · Score: 1

    It's not really object oriented until it can do true multiple inheritance

    ... and with that, Java weenies all over the world are crying into their milk.

    +1

    --
    Not everything that can be measured matters; Not everything that matters can be measured.
  70. FUD by dolmen.fr · · Score: 1

    That's true: PHP's preg_replace just requires ugly escapes of the regexp metacharacters, and requires the human to do the hard parse. This also means that IDEs only see a bare string, so no coloring of the regexps. I don't see how this is an improvment.