love perl || die;
live perl unless dumb;
Developers really dislike Perl, and projects associated with Microsoft, at least among those who volunteer their views through Stack Overflow. The community coding site offers programmers a way to document their technical affinities on their developer story profile pages. Included therein is an input box for tech they'd prefer …
There is a lot of existing code you can pull in from CPAN. Pretty much anything you want has been done,
The hard bit is regular expressions used to fiddle with text.
It is ugly, But if you need it, it is powerful. The alternative of rolling your own code to pattern match in strings is much worse - particulary if you may need to work with ascii and unicode and other text coding schemes. That is why Linux is strung together with perl scripts. You know you will find it on any Linux machine.
This post has been deleted by its author
This post has been deleted by its author
No, quite the reverse. I've used both PERL and JS fairly equally, and would rather work in JS any day.
My biggest gripe with PERL is that there a thousand different ways to achieve anything, so when you visit SO or whatever, you never have a clue what style of code you are going to find, or if it is going to be a dirty hack or elegantly robust. In JS if it works, and doesn't use EVAL, you are pretty much fine.
> I started to learn perl - from books - and it was the worst experience ever.
I started learning it as a substitute for awk and various horrible shell variants. It was a great replacement for awk because it did everything that did, but with more power. It was better than shells because it had all the features a proper programming language has (eg, associative arrays) and had a single, fairly logical way of doing string interpolation (the worst part of all shells, which all decided on slightly different ways to handle the problem). Oh, and it's obviously much quicker to write in Perl than something like C.
For people who come at Perl from the same direction I did, it was a brilliant language. I guess that people who came to it later, and who aren't building on previous awk/sed/*sh experience, it can be kind of hard to understand the power (and even simplicity) that Perl delivered.
"I started learning it as a substitute for awk and various horrible shell variants. It was a great replacement for awk because..."
Ditto. It was created as a reporting language, to replace & unify awk, sed, sh, a job it did, and continues to do, splendidly. A system administrators language, not really meant for writing general apps. Perhaps its success was its undong, as it came to be used for CGI in the 90's Internet, then spread to more general applications, which it was never really intended for, despite all the tweaks and OO extensions.
The Stack Overflow survey is a pointless. Of the 16 languages presented, a respondent will have used only about 2. Whatever.
Of the 16 languages presented, a respondent will have used only about 2. Whatever.
Speak for yourself. I've used 10 of those and they still don't list the one I hate the most: Lisp.
I've used Lisp on two different platforms and it annoyed the hell out of me both times. There's a reason I haven't touched it since 1989, and not just its rarity. There's also a reason why it lives up to its sodding joke name.
Speak for yourself. I've used 10 of those and they still don't list the one I hate the most: Lisp. I've used Lisp on two different platforms and... I haven't touched it since 1989...
Yes yes, and I could bore you with my 36 years of programming experience, but won't. We are all experts here. My point was, most survey respondents are likely to have used only 2 or 3 languages to an expert level, and have little or no basis for judging the others. For example, I dislike Python, but having used it for just a couple of months, I am not really qualified to say, because I haven't yet experienced the full benefits of advanced Python.
"For example, I dislike Python, but having used it for just a couple of months, I am not really qualified to say, because I haven't yet experienced the full benefits of advanced Python."
A couple of months IS "advanced Python". It thoroughly expects the user to have no idea what they're doing, which makes writing in it frustrating for anyonewho knows the rules and when to break them.
"VB is on life support, just some residual noise from the poor sods who have to work with VBA"
Thats what they said when .net came out but VBA will not go away (PLEASE HELP ME!).
As long as products such as Office remain in businesses I can't see how they can get rid of VBA, after ignoring it MS are being forced to update many of their unloved office products such as Access which have had failed attempts to go to the web (Through Sharepoint of course).
The biggest criticisms of Perl would be pervasive support for regexes in the language and the "there's more than one way of doing something". Loved by devotees but despaired of almost universally by others.
It has extensive libraries for just about anything and isn't going away, but it's certainly not growing either.
A while ago it looked like we were all going to have to learn Javascript but it seems that this is going to be eclipsed by WebAssembly getting universal support from all the browser makers.
VB is on life support, just some residual noise from the poor sods who have to work with VBA.
PHP remains my favourite bugbear for its unnecessarily poor choices in syntax.
I started to learn perl - from books - and it was the worst experience ever. (in regards to what i was learning from a book, that is).
I'd recommend you read Moden Perl, then. Good book to read if you already know how to program and don't need your hand held.
@Shadmeister
It is as if the author of the language decided arbitrarily what seems like a good idea.
Almost, but not quite. Larry Wall had formal training as a linguist, so designed the language based upon how humans think rather than the easiest way to write syntax parsers. He also wrote it so that it was very useful for one-liners. There's quite a bit of syntactic sugar, but that's because it makes intent clearer. All of which makes it somewhat different from other languages you encounter. But if you can make the mental leap you may find it rewarding. The syntax is more natural, but it's so different from what you're accustomed to that it's a bit of a leap to realize that it's actually better the way Perl does it.
For example, the "unless" keyword. Sometimes it's a lot clearer to write
unless (condition) {code}
than
if (!condition) {code}
You'll probably find it perverse that you can place if/unless after code as well as before it, but it can make intent clearer.
If you think about it, English works that way. (emphasis is that you're so stupid you have to think about it).
English works that way, if you think about it (emphasis is that you're bright enough that you probably don't need to be told to think about it).
And, of course, regular expressions are first-class citizens. In other languages they're grudgingly shoe-horned in. Any time I use a regex in another language I end up swearing at the hoops it forces me to jump through. Often they're not very big hoops and it's not much of a jump, but it's irritating.
There's much more I could say, But you probably won't believe that either. :)
Hmm, the trouble with the English language is that it is born out of an interpretation of the world around us, as we sequentially encounter it and respond to it in complex and convoluted ways. Mathematics (for the last 2000 years) has made good progress distilling and abstracting the inherent mess that is the organisation of the human mind into it's branch called logic. This benefits software development by allowing a more or less uniform way to express problems and their solutions. Some might even go so far as to talk about computer 'science'. This implies standardisation. Whilst i grant you that software is written in computer 'languages', it is frankly a grotesque regression to try to implement software development in the style of a human language (and thus mind). The ideas expressed in language and the mind are greatly open to interpretation, making the interaction based on that massively error prone (ever misunderstood anyone and got annoyed, argued or in a fight? Many people have literally died over these issues). Sadly Perl is no different. It is the interpretation of a single mind and all it's quirks, and instead of allowing you to be a scientist, with all the standards and ability to communicate rationally with your peers, Perl forces you to adopt the style of a madman.
Regular Expression support side, Perl is INSANE!!!!!!!!
Obviously i'm late to the party here, but if I can stop one more person learning Perl, i'll take all the flak needed
"I started to learn perl - from books - and it was the worst experience ever."
'Programming Perl' and many of the manpages are indeed painful to read due to the appallingly verbose and chatty writing style. There are much better books like 'Effective Perl Programming' and 'Perl Best Practices" which don't make you want to jam sharp sticks in your eyes after the first couple of pages.
The language itself isn't too bad.
Sometime in the 1980s I first needed to learn C. I picked up the C book, K&R.
After reading the whole thing, it told me little of any value. Most memorably, I came out puzzled: surely C does dynamic memory allocation? Yet I had to ask "what's the C equivalent of Pascal's new"? Yes, it's true, there is not a single mention of malloc in the whole of K&R[1]!
In fact, the most informative learning resource I could find was a Microsoft VC++ manual. Despite the fact that I wasn't even working on an MS operating system, let alone with their compiler. It just happened to be something I could find.
Towards the end of the '80s, I read Stroustrup on C++ and found him a lot more informative. Though when I wanted to get to grips with STL in the 1990s, I found again a great gap in available documentation.
Perl was so much easier, with all the docs built in. Never looked at a Perl book, though.
[1] I understand that may have changed in later editions of K&R.
"And every time I hear that song, my ear hurts."
an earworm is like a babelfish, except that it plays the damn song in your head and feeds off of your insanity [as opposed to doing what the babelfish does, which is like symbiosis]
which makes for a nice distraction-level side topic: an excellent exercise in mental discipline is to teach yourself how to shut off an earworm on demand. many positive benefits.
"Developers are still fighting about TABS vs SPACES"
Everyone knows that hard tabs are *EVIL* because what you see in the editor vs what you see with 'less' should look the same, on ANY platform, or your indents become redonkulous.
Unfortunately hard-tabs still needed for 'Makefile'.
also fun going with the "everyone knows" fallacy, just because, trolling [see icon]