6 ms·
I'd be genuinely interested in reasons why I should learn Perl? I've been hacking away at some Perl interfaces lately but finding it difficult. It seems like a
by new299 14y ago
I'd be genuinely interested in reasons why I should learn Perl? I've been hacking away at some Perl interfaces lately but finding it difficult. It seems like a big language (I'm reading Perl Programming, which is certainly a big book).
So rather than just hacking away, is there a good reason I should learn the language properly and push through "Perl Programming" or say learning Ruby, Python or golang really well. Will Perl remain relevant in 15 years time? Or at least more relevant than other current languages with similar applications?
I should say that I come from a background of C and C++ programming, which may effect my mindset somewhat.
- peteretep 14y agoI watched a keynote recently where Guido - the Python guy - made the point that Ruby, Python, and Perl are all essentially the same language. I like Perl because it's: * Stable, reliable, very very mature * Has a testing culture really second to none, excellent testing tools, and a unifying testing mechanism (TAP) * CPAN really is awesome * Almost any tool you enjoy from the other languages, Perl has an equivalent
- jonathansizz 14y agoInstalling a new version of Perl doesn't break your old code! This is not true for Ruby (I'm not sure about Python as I no longer use it much), which is a huge argument in favour of using Perl over Ruby. Having said that, it's certainly possible to use all of these languages, and once you are good at one, it should take little extra effort to learn the others. All of them have their strong points and you'll probably regularly see code in each of them, so just learn them all.
- harbud 14y agoExcept perl 5.17.6! (I suspect the hash randomization feature will cause a lot of disturbance)
- jnazario 14y agoi'll wade in. note that i'm bigoted against perl, i'll say so clearly up front. perl is better than shell scripting at automation, this much is true. perl has a strong use case there. had, i'll argue. perl's idioms and structure promotes wonky, hard to read and hard to maintain code. it's true. get even the most die hard perl fan a beer or two and they'll wind up admitting it, sheepishly and quietly. but yeah, perl too easily promotes a mess. and when you have to maintain code, borrow code, etc .. readable code matters. my biggest complaints about perl usually fall into the bucket that perl fans claim are its strengths. brevity, wit, etc. those wind up confusing almost all perl developers and users, in my experience, because you have to shift gears mentally to figure out wtf a piece of code is doing, what the developer intended it to do, and thus diagnosis is a pain. too many perl users just laugh and say, "yeah, i can't figure it out either." funny until you realize they're laughing about wasting your time. my second biggest complaint falls into the reusability of perl by its design. not so modular without some surgery (minor or major, depending). the C (or ruby or python) code that people trained on perl develop is, almost always, horridly inefficient. CPAN is nice, i wish my language of choice (python) had as extensive a library so easy to use. and then you get into the mess of CPAN, which is littered with half completed, poorly documented modules. you wind up having two or three modules that do the same thing but are dependencies elsewhere or actually implement some promised functionality, etc. (cheeseshop, pip, etc yes ... but so much stuff isn't deployable like that is my point...) the perl documentation library was a big selling point about 10 or 12 years ago, not so much now. everyone else caught up is my point. python, ruby, etc are now mainstream. the "perl is everywhere" mantra used to be compelling, too. but python and ruby are just as widely available on systems and ... far more suited to long term development and maintenance than perl is. again, "better" languages for long term use and development are now mainstream. they weren't before. i tend to sum all this up for someone with "perl sucks" or "don't use perl, it promotes brain rot". and no, i wont revisit my thinking. perl had its day, but i think the sun has set and rightfully so.
- pyre 14y ago> "don't use perl, it promotes brain rot" > and no, i wont revisit my thinking. "I don't think this is the tool for the job, THEREFORE IT ROTS YOUR BRAIN! If you try to talk to me about that, I will chant, "I'M NOT LISTENING" over and over with my hands on my ears." Really?
- scott_s 14y agoI think that learning a scripting language is critical, but which scripting language is not. I used Perl for a while, then picked up Python, and I just adore Python. But pick one of Perl, Python, Ruby (or even Bash), and you're in good shape. So, my actual advice is take a look at Perl, Python and Ruby, see which one excites you more, and commit to learning it for a while.
- new299 14y agoI've actually written small projects in all of them. The one that excited me the most was Ruby (and outside of scripting, golang). Ruby seems clean and small, which I like. But I also question the long term prospects of various languages. There seems to have been an explosion of languages in the last few years and I wonder how many will survive long term. Then I'm possibly just spoiled by C and C++, which just seem to maintain a (relatively) mainstream status.
- scott_s 14y agoRuby, Python and Perl are older than you probably realize. Ruby started in 1993, Python in 1991, and Perl in 1987. I would not worry about their long term prospects: they've been around for a while, and I think it's a safe assumption they will be around for a while still. Avoid decision paralysis. If you like Ruby, go with it. As I said, I don't think which scripting language you pick is all that important, but I think it's crucial that you know one.
- emeraldd 14y agoIf you play around on *nix machines you'll want to know perl, at least how to read it and find translations for the things you can't read. You'll find it all over the place . . . http://imgs.xkcd.com/comics/lisp.jpg http://imgs.xkcd.com/comics/lisp.jpg
- noonespecial 14y agoBecause it's better than bash and it's almost certainly already on you system. Even if that system happens to be your office's Centos 3.5 server.
- jcurbo 14y agoI assume you mean "Programming Perl", aka the Camel book. (has a camel on the cover) In my experience the Camel book is better as a reference and you should use "Learning Perl" to actually learn the language. It's structured better for that task I think.
- rcthompson 14y agoYes, Perl is a big language. But you don't have to learn anywhere near the whole language to be productive in it.
- kamaal 14y agoLet me tell you why learning Perl is important. You will never realize why Perl is important unless you start using Perl to solve the problems it was designed to solve. The whole thing really is Perl doesn't have any real competition. And it has always been the case. And even the competing languages more or less end up largely looking like Perl. The biggest examples are ruby and Perl 6 itself. Python is not Perl's competitor. It took me a lot of time to understand this. Python is really for bored Java programmers, who are in some desperate need of dynamic power. And its great in that area. The language is readable, quickly learn able but what beyond that? Unfortunately the problem with Perl is something similar to that of Unix utilities, unless someone shows you how to do magic with them. You never truly understand why and what purpose they serve. You can read as many man pages as you want, and think about a million use cases. But unless you see the next bearded sysadmin down your cubicle do a computation task in a combination of 6 text processing utilities sewing them with pipes, what other wise your Java programmer would have take six months to write- You will never truly appreciate the beauty of it. That's the reason why awk/sed/cut/tr/Perl et al have never gone away and probably never will. I have seen Java programmers even wonder what 'Text processing' is, and found it strange that a regular expression can be anything more than 10 characters. The problem with most of those programming domains is most of them consume data in xmls or database records, where data is really reduced to a form where you don't have to do much to take it from there. That is why when you try understand why you must learn Perl from the perspective Java, you never get a reason. If you are learning any language from that Perspective, then all look the same. Because what else is there more to a language than decision statement, loops and ways of modularization? Change this situation and that is when you see why languages like Perl are still alive and used all the time. Back in the 80's a person called Larry Wall faced a situation where he had to solve a problem where he needed to deal with a lot of adhoc text data, in many adhoc formats all needed to made sense of then sent through a traditional program and then made a report out of it. When he tried to solve it, he figured out he was using many unix text processing utilities and C programming language in shell scripts. He figured out that this made case for a separate programming language. When he sat down and put down some design in place he saw three details emerge out of it. Which are: 1. Manuplexity: Ability to manipulate things quickly. Like Text. 2. Whipiptitude: Ability to whip things up quickly. 3. Express yourself: To use principles of natural languages as applied to programming languages. Finally there is a guiding principle: which really is Laziness, impatience and hubris. If you really want to learn Perl, you should be reading books like Higher Order Perl. You should see tough text processing problems. You should see how you can rapidly prototype, even without the help of Modern IDE's which is rarity for most high level languages today. You should see how CPAN helps you avoid re inventing the wheel(s). You should see why things Moose and DBIx::Class are not there in other languages. You should see why the flexibility, extensibility leads to packages like Devel::Declare. You should see the testing culture. Perl was born and raised among hackers, I mean the true bearded hackers. Who have experience of building things without reaching to the Google homepage every 30 seconds. If you have time, I would advice you to take some time out and read Tom Christiansen's essays back from those days. Take some time out to read JAPH and Golf contests from those days. You will see how much time those folks spent in doing the real hacker work, how many small succinct and yet extremely power solutions exist to so many problems you are likely to face everyday. When you truly look at the use cases, you realize that Perl doesn't really have much competition in its stride. Even the languages designed to replace it look like Perl. Think of it like Greenspun's rule for Perl. Even if you don't learn Perl I would definitely advice you to learn Unix utilities in quite some detail. That way you will realize and see a very different part of the world.
- uvtc 14y ago> I'd be genuinely interested in reasons why I should learn Perl? Perl 5 is handy, putting oft-used tools within arms reach. There are a lot of useful and mature Perl 5 modules available (at CPAN). The language has some warts you'll hear folks complain about. Perl 5 is considered a power tool for GNU/Linux & unix admins. Perl 5 infrastructure is great. Community support is great. The docs are great. For small scripts that involve text manipulation (with regexes) and working with the OS and with other scripts, it's very tough to beat Perl 5. The Perl 5 goals appear to me to be: be handy (sometimes providing more than one way to do it), be useful (bending the rules sometimes is ok, but try not to wreck up the place), and try to do what I mean. Python is easy to pick up, is pretty uniform, and has a nice repl. You'll often find your Python code working correctly the first time you type it. You should be able to learn the language itself in a very short amount of time. The Python goals appear to me to be: be easy to learn, be mostly uniform. For more, open a repl and type `import this`. The Perl 5, Python, and Ruby communities are somewhat different from eachother. > Will Perl remain relevant in 15 years time? Can't answer that, but I don't think Perl 5 is going anywhere for a while. Too much stuff runs on Perl 5.