News for hackers. Stuff that matters.
Re:In Praise of Perl 5 by Pacabel on Thursday February 27, 2014 @05:47PM (#7315805)
But is that really unique to Perl these days? It may have been true in the mid-1990s, but things have changed since then.

Python and Ruby both have a much cleaner syntax, yet still offer very comparable functionality, excellent portability, ample standard and third-party libraries, excellent documentation, supportive communities, great regex support, and basically everything else that Perl offers.

Since everything positive about Perl is also offered by alternative languages today, and those alternatives are themselves much better than Perl in some respects, Perl seems like a less and less enticing option each day.

Re:In Praise of Perl 5 by kamaal on Thursday February 27, 2014 @10:56PM (#7317158)
>>But is that really unique to Perl these days?

Yes. Scripting powers of Perl are unmatched.

>>It may have been true in the mid-1990s, but things have changed since then.

Hardly anything has changed. No language has taken scripting that seriously. You are likely confused between dynamic languages and scripting langauges. There is a big difference. If you haven't noticed, well then that's the whole point behind Perl. You really need to use it to see what it is.

>>Python and Ruby both have a much cleaner syntax

Its not about having a cleaner syntax. Making it easy to learn, only means the complexity is left to the programmer to handle now. Either way some one needs to handle the complexity, Its either the programmer or the language. If you make the language simpler, the complexity burden shifts to the programmer.

>>yet still offer very comparable functionality, excellent portability, ample standard and third-party libraries, excellent documentation, supportive communities, great regex support, and basically everything else that Perl offers.

Python takes great care to purposefully avoid offering every thing that Perl offers.

>>Since everything positive about Perl is also offered by alternative languages today, and those alternatives are themselves much better than Perl in some respects

You will have to substantiate that point with some evidence.

>>Perl seems like a less and less enticing option each day.

That is being told since what? 1988?

Re:In Praise of Perl 5 by danellis on Thursday February 27, 2014 @11:12PM (#7317204)
> Yes. Scripting powers of Perl are unmatched.

Can you offer any examples of how that is true?

Re:In Praise of Perl 5 by kamaal on Thursday February 27, 2014 @11:51PM (#7317300)
There is monumental material on this in sites like Perlmonks.

I started writing a detailed reply, but half way down I realized it might become a booklet project[Which is a very good project idea by the way]

I also realized I may not be able to justice to 3 decades of Perl history in one HN comment.

So the best I can do is point you out to two links.

http://hop.perl.plover.com/ and http://onyxneon.com/books/modern_perl/

Re:In Praise of Perl 5 by mattikl on Friday February 28, 2014 @04:00AM (#7317775)
Perl is a great tool for scripting, but calling it "unmatched" is hard to justify. Knowing Python or Ruby well, you can be efficient scripting with them, and that's what scripting is all about, getting the job done fast.

Higher Order Perl is one of the best books I've read, but I feel that's much more about software development than scripting, teaching the fundamental techniques in functional programming.

Re:In Praise of Perl 5 by skrebbel on Friday February 28, 2014 @03:29AM (#7317706)
So in order to be convinced that Perl is a force to take seriously, we need to read two entire books?
Re:In Praise of Perl 5 by singingfish on Friday February 28, 2014 @04:59AM (#7317900)
Short answer: python is perl for bureaucrats and computer scientists. Ruby is perl for people who realised php is awful.

Perl fits the same niche as English does for natural language - used everywhere, easy to learn for simple cases,very tough to master. The way I like to say it is that while most programming languages help you think more like the computer, perl helps the computer think more like you do.

Re:In Praise of Perl 5 by kamaal on Friday February 28, 2014 @07:40AM (#7318377)
In order to convinced about anything, you need to read documentation. And you need to learn how to read it well.

I've read the awk and sed man pages so many times, yet everytime I have to type a command I have to read it again.

Re:In Praise of Perl 5 by JimmyM on Friday February 28, 2014 @03:46AM (#7317745)
Those books look pretty general. Could you perhaps give just one or two examples which make Perl great specifically for scripting, to someone who does not know any Perl at all?
Re:In Praise of Perl 5 by danellis on Saturday March 01, 2014 @02:30AM (#7323517)
I was really just asking for a couple of short examples of scripts that demonstrate your point, based on Perl as it is now, not anything regarding its history.
Re:In Praise of Perl 5 by Pacabel on Friday February 28, 2014 @05:55PM (#7322101)
"Scripting" is a pretty vague term. If you mean quickly writing one-off programs, then there are many languages that are just as good as Perl, if not significantly better.

It's pretty clear that Perl does not hold the prominence it once held in the 1990s. So, yes, it is clearly becoming a less-enticing option for a lot of people, whether you're willing to admit this or not.

Re:In Praise of Perl 5 by _delirium on Thursday February 27, 2014 @06:04PM (#7315909)
It could be familiarity, but for small- to medium-scale "scripts", I still find Perl to be the best alternative to bash+sed+awk+grep thrown in, when I want to go to something more conventionally programming-ish. Basically its original use-case, before Modern Perl.

You can use Python for that, but the jump from Unix shell to Python feels bigger; everything is more verbose and less awk-y in Python. Which can be good for maintainability of bigger scripts, but feels heavyweight for some stuff.

Re:In Praise of Perl 5 by wting on Thursday February 27, 2014 @07:54PM (#7316549)
Are you aware of sh? http://amoffat.github.io/sh/
Re:In Praise of Perl 5 by kamaal on Thursday February 27, 2014 @10:59PM (#7317168)
Its not about having function to call shell commands. That way I might as well use C or C++ or Java.

Its about how such a feature interplays with rest of the language.

Frankly speaking in Python it looks like added after a lot after thought and a lot of reluctance. Same with regular expressions.

Re:In Praise of Perl 5 by _delirium on Friday February 28, 2014 @07:32AM (#7318350)
Yeah, it's not just about shelling out, but about being able to write Perl that works sort of like an awk script, just with more of a real language attached to it. Functions that implicitly work on the current line, lightweight regex syntax, the <FILE> magic, bash-style file tests (-e/-r/-d/-f), etc.
Re:In Praise of Perl 5 by codygman on Thursday February 27, 2014 @09:33PM (#7316921)
And the Haskell equivalent for a performance and type safety boost:

https://github.com/yesodweb/Shelly.hs

Re:In Praise of Perl 5 by PuercoPop on Thursday February 27, 2014 @06:19PM (#7315994)
Perl has reader macros and a meta-object protocol upon the object system is built with. Ruby and Python don't have either AFAIK. That is an example of what the OP is saying with Perl is an extensible language.
Re:In Praise of Perl 5 by einhverfr on Thursday February 27, 2014 @08:53PM (#7316748)
> Perl has reader macros and a meta-object protocol upon the object system is built with.

More specifically, Perl has advanced features with which meta-object protocols can be built with. See Class::MOP on which Moose is built.

> That is an example of what the OP is saying with Perl is an extensible language.

I think the difficulty with Ruby and Python is that both are fully object-oriented, which means it is difficult to create something that is truly orthogonal to the object model.

Re:In Praise of Perl 5 by marcosdumay on Thursday February 27, 2014 @09:25PM (#7316886)
Python is not fully object-oriented.
Re:In Praise of Perl 5 by rat87 on Friday February 28, 2014 @04:11AM (#7317801)
In what way?
Re:In Praise of Perl 5 by systems on Friday February 28, 2014 @04:10AM (#7317796)
how does Perl have reader macros, can you please point to a link if possible?

i couldnt find this one simply searching online

Re:In Praise of Perl 5 by mst on Friday February 28, 2014 @05:30AM (#7317976)
Look at Devel::CallParser and Keyword::Simple
Re:In Praise of Perl 5 by einhverfr on Friday February 28, 2014 @05:11AM (#7317930)
I think Perl 6 has them, but not Perl 5
Re:In Praise of Perl 5 by banachtarski on Thursday February 27, 2014 @06:46PM (#7316189)
You should learn Ruby.
Re:In Praise of Perl 5 by systems on Thursday February 27, 2014 @07:21PM (#7316393)
Re:In Praise of Perl 5 by davvid on Friday February 28, 2014 @02:09AM (#7317556)
basically everything else that Perl offers

...except for performance. The GIL is Python's achilles heel; if you throw threads at the problem Python gets slower while Perl actually uses all your cores. C.f. http://yaketyhack.blogspot.com/2010/07/threading-perl-vs-pyt...

BTW, I love Python.

Re:In Praise of Perl 5 by otterley on Friday February 28, 2014 @04:11AM (#7317800)
Also, a good debugger. Perl's debugger is still far, far better than Python's or Ruby's.
Re:In Praise of Perl 5 by collyw on Friday February 28, 2014 @05:55AM (#7318064)
Is it?

I generally use a graphical debugger in Eclipse. I have used Python and Perl, and can't see too much difference between them. Whats better about the Perl one?

Re:In Praise of Perl 5 by kbenson on Friday February 28, 2014 @02:27AM (#7317583)
Pfft, that guy obviously doesn't know how to use code blocks. :D
Re:In Praise of Perl 5 by einhverfr on Thursday February 27, 2014 @08:51PM (#7316744)
> Python and Ruby both have a much cleaner syntax

Cleaner syntax than the declarative class mentioned in the article?

> Since everything positive about Perl is also offered by alternative languages today, and those alternatives are themselves much better than Perl in some respects, Perl seems like a less and less enticing option each day.

To my mind though the benefit is in mutability of the language. Yes, there are other languages in this category (rebol, red, lisp), Perl is somewhere between these and Python and Ruby. If I were to order them from most mutable to least, I would go lisp, rebol, red, perl, (python and ruby). This is a powerful thing and of course with great power comes the possibility of misuse.

Re:In Praise of Perl 5 by mst on Friday February 28, 2014 @05:37AM (#7317999)
Every time I try and write python or ruby I get an hour or so in and find that I'm writing 5x as much code as I would in Moo/Moose just to express the object design I want.

I've been known to say "perl5 is a lot like ruby except with usable OO" and it's very much a "ha ha only serious" sort of comment.