Anyone know any advantages of Perl?

I’m doing some work with Perl at the moment and it’s driving me totally mad. Who on earth thought that any of these features would make for a good language? How come it is so popular and successful?

Seriously, the namespaces, the way you make function calls, pretty much everything about the language is insane. It’s like trying to knit yourself a car out of spaghetti. I’m guessing it’s just that I’m accustomed to using languages that were designed by intelligent and sane people and there must be something good about it, but I can’t for the life of me work out what.

Any suggestions?

Never used it myself, but I’ve worked with people in the past who were very fond of Perl.

The argument seems to be, if a task doesn’t deserve to be coded in a proper language, then code it in Perl! You can get Perl to do some pretty useful stuff in the time it takes a Java programmer to type “void main()”.

But, no, not a language I have any desire to use myself.

I enjoy Perl. I worked a job once where I had to write a complete maintenance system for website scrapers in Perl. It was my first exposure to the language. I walked away pretty damn good at it (although i haven’t really touched Perl since then). Things to keep in mind:

– it was never intended to be used for real apps, just scripting, text parsing, “glue code”
– it wasn’t intelligently planned out and developed, it grew like a weed and a lot of its features and hiccups are a result of that
– for years and years it was the only game in town.

Perl gives you an obscene amount of freedom. As long as you don’t abuse that freedom you can put together some nice scripts that are easy to maintain. It’s the people that go insane on the shortcuts and clever way of doing things that produce scripts that are impossible to even figure out what they do.

And finally … look to Ruby if you don’t like Perl. It was originally intended to be a Perl replacement, but it’s much better. Ruby is a gorgeous language.

I do a lot of Ruby. Going to perl feels a lot like stepping out of my foundry and knocking flints together.

I think it’s the namespacing thing that is doing my head in. The whole concept of things being global by default just does my nut in.

I don’t know much about perl but I know is one of the strongest languages when it comes to strings.It’s fast and has many functions that makes string usage easier. That’s the advantage…About the disadvantages …

Perl is worse than Python because people wanted it worse. Larry Wall (Creator of Perl), 14 Oct 1998

I would actively encourage my competition to use Perl.Sean True, 30 Mar 1999

So I think Python might be a better choice .Bruce Eckel said that his favourite programming language is Python. Bruce Eckel is the writer of Thinking in C++ and Thinking in Java .(I saw something about thinking in Python , but I don’t remeber if the book is already out). Python also has some good libraryes for writting games (Pygame,PyOpenGL) and it can be used with java using Jython(which is made 100% in java).

Python is pretty annoying, too. I use it for some things (the options were python and perl) and so far it has been a hairpulling experience. While python is imo the lesser of the both evils, it isnt any fun at all.

So, my advice is… check how good the documentation is before jumping into another language. Its a pretty good indicator how much fun (if any) it will be.

Python seems to be pretty successful with Civilization IV though…

Perl is self-obfuscating and impossible to read by anyone but the original author, so it is safe to give out your source code directly… no need to worry about decompilers.

That is actually very accurate…

Half of what I’m doing is maintaining someone else’s perl. I don’t think it’s particularly poor, but it’s pretty hard to follow in places…

* blahblahblahh wagers it would take you less time to write a perl-to-C [or any other procedural you’ve got a decent IDE for - pascal might be easiest for perl?] (and back) round trip compiler, edit in eclipse, then recompile back to perl :P.

If I wrote that in perl I would become so good at writing in the language that I wouldn’t need to have written it.

At the moment it’s the function calls that do my head in. You don’t get named parameters, you just pass an array, so you call mySub( $a, $b $c ) and in mySub you just have a parameter array @_ containing $a, $b and $c. That is fine if you’re passing single values but if one of your parameters is an array itself you end up having that as part of the parameter list so if $a was an array you would get $a[0]. $a[1], $a[2], $a[3], $b, $c as your input parameter.

I know there are workarounds and I’m sure it’s mostly just something you need to get used to but it’s very annoyingly confusing to start with.