DEV Community

Doshirae
Doshirae

Posted on

Why do people like Perl?

I see lots of people being super happy with Perl, but I don't understand.
What does make Perl so enjoyable to those people ?
I mean, there isn't even arguments to functions

Oldest comments (32)

Collapse
 
lpasqualis profile image
Lorenzo Pasqualis

They like it because it is comfortable to them; they have learned to use it and know they can solve problems with it. They have the tools handy, they are familiar with the libraries and can get going quickly on any project using it.

It has to do with confirmation bias and normalcy bias. You tend to stick with what you know, appreciate and defend stuff you invested a bunch of time on, and resist change.

With every language under the sun, you'll find a range of emotions going from blind love to absolute hatred. It's like for all technologies. Some people love PCs, others hate them. Some people love iPhones, others prefer Android. The debate is almost pointless, as it has to do with emotions and personal attachment more than anything else.

Collapse
 
hcrudolph profile image
Hans Christian Rudolph

Being able to hack together a quick solution in Perl is just pure joy to me! While I haven't used Perl for any big, long-term software projects -- it probably wouldn't be my language of choice for these purposes -- I believe there is great value in having such a tool for quick-n-dirty scripts that you might only need temporarily, e.g. for test data creation. In that sense, Perl can be the most efficient language IMHO. Plus, I still think that it provides the best experience when working with regular expressions.

Collapse
 
dwd profile image
Dave Cridland

While I was at university - so about 20 years ago now - I did a fair amount of Perl. Perl was the scripting language, to the point where if you said you were writing a script, it was taken as read that you meant Perl. It was great at hacking out quick and often dirty solutions to problems. It was the language of choice of the sysadmin. Yet even then, it was well known as a "write-only" language, and generally looked down upon by "real" programmers.

But for sysadmins, it was awesome. Don't compare it to Python, or C++, though - compare it to Bash, Awk, and Sed. These were its progenitors, not C. And it beat them hollow. It was written as, and excels as, a glue language.

Perl programmers went in two directions. Some, like me, drifted onto other language choices, as things like Python grew to handle some of the space Perl occupied, and Bash itself grew better. Sysadmins turned into DevOps and got tooling like Ansible and so on.

Others focussed on trying to modernise the language with ever more modules in CPAN, and ever more language features built on the byzantine nest of references and blessings that makes up Perl.

Collapse
 
joshcheek profile image
Josh Cheek

Love this answer! It's worth noting that Ruby stole enough from Perl, that most of what people would use Perl to script, Ruby does just as well.

Collapse
 
halt_6kere9 profile image
Halt! 6 kere 9?

Do they?

Collapse
 
monsieurcellophane profile image
Monsieur Cellophane

"There isn't even arguments to functions". This is so wrong in so many dimensions.

Collapse
 
doshirae profile image
Doshirae

What I meant was that, by default, you don't have signatures to functions, only the @_ array

Collapse
 
jamesrgrinter profile image
James R Grinter

Last I checked, neither does standard JavaScript, but that’s not held it back.

I write a lot of Java these days, but I still write some Perl (and, depending upon the problem to be solved, and the situation in which it needs to run, shell scripts and PHP) and some JavaScript too.

Picking the right language for the task at hand is something you learn with experience, IMHO.

Collapse
 
kyle_stratis profile image
Kyle Stratis

Many scripting languages don't. Most Python projects use **kwargs to not have to enforce specific function arguments.

Collapse
 
blazselih profile image
Blaž Šelih

It has been a while since I did any real work in Perl, but there is one thing I really miss in (most?) other languages. That is regular expressions built right into the core of the language.

Collapse
 
computersmiths profile image
ComputerSmiths

I used to code amost exclusively in Perl, primarily because of CPAN. You could find anything on CPAN. Now I use almost exclusively Python, because Raspberry Pi, and you can find almost anything with Google on Pip or Stack Exchange or ...

Collapse
 
stevieb9 profile image
Steve Bertrand

I wrote and published WiringPi::API and RPi::WiringPi specifically so myself and others can use their favourite language (Perl) on the Raspberry Pi.

At work I code in Python, but Perl has, and always will be my favourite language.

Collapse
 
val_baca profile image
Valentin Baca

| What does make Perl so enjoyable to those people ?

If you ask this question to N people, you will get N answers (protip: this applies to most things).

| There isn't even arguments to functions

Not true. It's just packaged differently.

Like others have pointed out, more modern languages like Python and Ruby got to learn from Perl's design and "mistakes"

Compared to other languages, Perl is old (aka 'mature' aka 'crusty' depending on your attitude).

What that translates to is:

  • Supports many methodologies. You can just script or you can build a complex OO package.
  • Many, many packages. Python and Javascript may have an explosion of new packages, but they're all playing catch-up with Perl
  • Ubiquity. It's on and runs nearly every machine.

Sure the language has warts, it's as old as I am!

I'd highly recommend the book "Learning Pearl". It really gives a solid introduction to the language. Granted Perl is pretty unreadable at first, but so is {C, Objective-C, Haskel} until you learn {C, Objective-C, Haskel}.

Collapse
 
scottanderson42 profile image
scottanderson42

Quick note on "many, many packages": by what metric are you gauging this?

Also, my favorite Perl book is the "Perl Cookbook" - definitely not for learning from scratch, however.

Collapse
 
val_baca profile image
Valentin Baca
Thread Thread
 
vanhoesel profile image
Theo van Hoesel • Edited

interesting that it counts distributions, rather than modules... 35,933 vs 194,343, which would have it put on par with Java. I hate statistics and numbers, they somewhat tend to tell you a lie all the time

Collapse
 
thorstenhirsch profile image
Thorsten Hirsch

People being super happy with Perl? That must be Perl 6. ;-)

Collapse
 
jkirchartz profile image
Dr Rev J Kirchartz • Edited

I always loved computers, tried hacking QBasic games on my dad's old IBM clone, so when I was in my early teens I decided to try to learn Perl. I got one of those "mastery in 24 hours"-type books from the library, and I remember crying because I'd "never be a real programmer." Nothing made any sense. Since then I kept trying, kept learning, batch scripts, C++, html/case/JavaScript, added ColdFusion, then PHP, BASH scripts, Python, Ruby, Node. Recently I tried again to learn Perl, it's infinitely easier now that I have a stronger grasp of programming concepts. CPAN is a fantastic precursor to PIP, NPM, Yarn - following the Hacker Ethos developed at MIT & Standard, sharing well developed code between hackers to keep making improvements and make programming easier. Without Perl some of these later languages would've never been made. (*cough*PHP*cough*) I've enjoyed finally picking up from my earlier failure.

PS. Arguments are passed to Perl functions in arrays you have to unpack, sure it's a little different, but each language has its quirks.