News for hackers. Stuff that matters.
Re:Perl Turns 34 Today by pkrumins on Saturday December 18, 2021 @07:14AM (#29603908)
World's #1 Perl advocate and fan checking in.

Start with the greatest books every written:

Programming Perl - https://www.oreilly.com/library/view/programming-perl-4th/97...

Continue with the second greatest book ever written:

Intermediate Perl - https://www.oreilly.com/library/view/intermediate-perl/05961...

Followed by equally amazing book by the greatest programmer in the world:

Higher Order Perl - https://hop.perl.plover.com/

And of course:

Mastering Perl - https://www.oreilly.com/library/view/mastering-perl/97805965...

To get super quick in the command line, also you might want to get my book:

Perl One-Liners Explained - https://nostarch.com/perloneliners

Finally, join #perl on Libera Chat.

AS A NEW USER WE LOVE YOU WITH GREAT HUGE LOVE.

(Also screw all Python programmers, what a bunch of losers with their indenting rules and PEPs. Weirdos. Whenever you hear somone say Python is good or interesting, run.)

Re:Perl Turns 34 Today by heresie-dabord on Saturday December 18, 2021 @09:57AM (#29604898)
You had my agreement until

> (Also screw all Python programmers, what a bunch of losers with their indenting rules and PEPs. Weirdos. Whenever you hear somone say Python is good or interesting, run.)

Even as a jest, it's a poor representation for the Perl language.

Python has problems but has enjoyed success for a few reasons.[1] I think one of the worst side-effects of Python is that Python programmers tend to look at any powerful language with disdain if it has any non [a-zA-Z] characters. "Can't we just replace everything with Python?!"

Becoming a language bigot -- or joking like one -- does not help.

Perl can stand very tall on its expressiveness, stability, speed and simplicity.

[1] I'm going to say...

a) Python is more readable, but makes the crazy compromise of using whitespace as logic.

b) Python has adequate threading for many use-cases.

c) Python's built-in OOP has better affordance than Perl5 OOP. BUT... Perl enables building anything you want. If you want a dictionary with only two methods, you can build it. And Perl5 will have a more modern OOP implementation.

Re:Perl Turns 34 Today by bmn__ on Saturday December 18, 2021 @11:12AM (#29605572)
> it's a poor representation for the Perl language.

The Python people started this fight in 2000 and have since said much worse and heaps more, most of it untrue and libellous; turn-around is only fair. Those who live in glass houses shouldn't throw stones.

Re:Perl Turns 34 Today by phlakaton on Saturday December 18, 2021 @11:30AM (#29605772)
There is no more a well-defined “Python people” than there is a “Perl people” – both of their user bases span industries and computing architectures, hobbyists and professionals, old bones and young bloods, true believers and weary journeymen – and they overlap significantly, for that matter. Talk about cutting off your nose to spite your face.
Re:Perl Turns 34 Today by Grinnz on Saturday December 18, 2021 @12:10PM (#29606201)
Sinking to their level doesn't move anyone forward.
Re:Perl Turns 34 Today by bloopernova on Saturday December 18, 2021 @07:35AM (#29604020)
I unabashedly love this comment.

As a somewhat "new" sysadmin/coder back in the early 2000s, those blue O'Reilly books were like a business card, comfort blanket, and encyclopedia all in one.

I'd add "Mastering Regular Expressions" and maybe "Perl Best Practices". Oh and definitely "The Perl Cookbook", because it mirrored the way I learn best; from needing to do "a thing" and finding an example that mostly fits what I need.

Re:Perl Turns 34 Today by dsr_ on Saturday December 18, 2021 @08:19AM (#29604282)
I have often wished for "The $language Cookbook" for many values of $language. Highly recommended.

I think "Mastering Regular Expressions" can be almost completely replaced by 'man perlre', but perhaps not for utter neophytes.

Re:Perl Turns 34 Today by bloopernova on Saturday December 18, 2021 @10:15AM (#29605034)
My only issue with man pages is that I can't flick through them away from my desk or computer/device.

Which makes me wonder how easy it is to make a pipeline for man pages to my Kindle device/app. Hmm. Another rabbit hole to follow, joy!

Re:Perl Turns 34 Today by sirsinsalot on Saturday December 18, 2021 @08:23AM (#29604303)
Ive read your other comments in this thread and was amazed to see you referring to yourself as an advocate.

I think you do the language a disservice and associate Perl with childish views on other languages.

May explain why Perl is struggling.

I really hoped unintelligent bashing of languages died out after those of us who were 12 in the 90s grew up and realised peoples tooling isn't a personal statement.

Re:Perl Turns 34 Today by ydant on Saturday December 18, 2021 @08:13AM (#29604236)
Looking back on it, I probably have those blue O'Reilly books ( and Perl Cookbook https://www.oreilly.com/library/view/perl-cookbook/156592243... ) to thank for starting me off on my programming career and influencing so much about how I grew as a programmer. Very informative books and fun to read. What a great set of authors.

I now program almost exclusively in Python (it's good and interesting) and Java. But occasionally I fall back to Perl for something that is just so much simpler - almost muscle memory.

Re:Perl Turns 34 Today by Siira on Saturday December 18, 2021 @08:09AM (#29604216)
I started with the one-liners book, and I recommend others do the same. It’s quick and useful for pretty much anyone who isn’t an AWK master. Then go learn more advanced stuff.
Re:Perl Turns 34 Today by pkrumins on Saturday December 18, 2021 @08:11AM (#29604226)
Thank you very much!
Re:Perl Turns 34 Today by zerocount on Saturday December 18, 2021 @09:07AM (#29604565)
Yep, Python's the new Visual Basic. Also the Rust people might be a little weird too since Rust likes to kick you in the nuts with its type system.
Re:Perl Turns 34 Today by HeckFeck on Saturday December 18, 2021 @07:39AM (#29604044)
> Also screw all Python programmers, what a bunch of losers with their indenting rules and PEPs. Weirdos. Whenever you hear somone say Python is good or interesting, run.

Amen. This is my credo.

I had to program Python in my last job and I ran as fast as I could from that world of artificial limitation, and landed squarely in the land of camels and onions: The Promised Land.

Re:Perl Turns 34 Today by 7thaccount on Saturday December 18, 2021 @04:48PM (#29608858)
I've written a bit of Perl and have read quite a few Perl books (I legit probably own 10+), but generally prefer Python. I can't understand how someone open minded enough to be cool with Perl and it's strangeness, would be upset by something as trivial as whitespace. It obviously isn't that much of a problem as it's one of the most popular languages ever and used in so many domains with users ranging from children to Google's chief scientist and with it being a critical backbone of many companies and the defacto language to build an API for. It's fine to find it aesthetically displeasing if that is what you want.
Re:Perl Turns 34 Today by heresie-dabord on Monday December 20, 2021 @10:45AM (#29626153)
If I may engage you in discussion, friend...

> I can't understand how someone open minded enough to be cool with Perl and it's [sic] strangeness, would be upset by something as trivial as whitespace.

Thank you for the compliment of open-mindedness. Every language is strange to some degree until one becomes proficient. Notice your own grammatical error above. English too is strange until one masters it. But we won't blame people for making mistakes because bad code can be written in any language.

Whitespace is not trivial in Python. It has been promoted to logical operator.

Now everything that I type gets broken unless I use an editor to protect me. Oh, you might say, any modern editor should be capable! This leads to IDE dependence like Eclipse and PyCharm (both written in... Java).

There is none of this nonsense with Perl. I work on systems of every size with the simplest, most robust set of tools. I don't need a complex baseline just to write my code.

> It obviously isn't that much of a problem as it's one of the most popular languages ever and used [...] from children to Google's chief scientist [..] critical backbone of many companies [..] defacto language to build an API for.

C, C++, Java, Javascript and Bash are also very popular languages. The first three are more important that Python. And they are all unlike Python. Google has formally sponsored Python for some time, which certainly helps Python. Google has also been developing Go, which is itself a better language than Python in many ways. And Go solves the problem of formatting for readability in a sane way (go fmt).

An API can be expressed in many ways.

> It's fine to find it aesthetically displeasing

The above criticisms are objective.

However, I don't like how many lines idiomatic Python requires because of the whitespace promotion. At its best, Python allows clear, compact expressions such as lambdas.

At worst, Python is needlessly puffed with emptiness. Perl is as compact as the coder wishes it to be. It is easy to run perltidy and colourise the output for a formatted view if one prefers.

Re:Perl Turns 34 Today by 7thaccount on Monday December 20, 2021 @08:16PM (#29632660)
With perl you have to add all sorts of junk like "use strict;" and "use warnings;". There is no REPL to incrementally test small snippets. You have to remember all kinds of things such as context for sigils. I still don't have a problem with the language, it's just different.

I don't think anyone would compare Python to C or Java. C is good for microcontrollers and drivers (that sort of thing), while Java is good for large enterprise systems. Python on the other hand is an excellent scripting language. Much more popular than perl by the numbers where nearly all scripting, data science (well, R too), and ML is used. Every application I've seen in the last decade has had a Python API, but none use a Perl. I've literally never heard of a Python developer switching to Perl, but I've lost count of the number of folks switching to Python from Perl over the years (HN threads). Simply speaking, the numbers show that the faults of Python (there are many) are still less than those of Perl (also many). As far as whitespace goes, it means it's easy for all Python coders to read each other's code once you adjust for a spacing difference. No need to run something like "perltidy". I've never once needed a fancy editor like eclipse. I've used the little Tk editor IDLE, Spyder, just notepad ++, and Vim + Command Line just fine over the past decade, just like how I've used Perl.

All in all, they're both great languages with several warts. Google isn't replacing Python with Go. Their uses are very different. Obviously Go makes for a more performant backend, but requires significantly more code, so there is a trade off. I would bet that Python and Perl have a pretty similar amount of semantic density (or whatever it is called). Saying it is puffy nothingness makes little sense. Just something like iterating through a file is pretty much the same in both languages. The use of lambdas was discouraged by Python's creator as it means more stuff for developers to learn and keep in their head. Larry Wall's TIMTOWDI means that the developer gets more power, but there are 10 different ways to do something and a lot of folks REALLY don't like that as it makes maintenance and learning more challenging.

Re:Perl Turns 34 Today by heresie-dabord on Tuesday December 21, 2021 @11:02AM (#29638646)
Thanks for your reply. I think your tone was fine. But you went a little astray. We were just talking about whitespace being promoted to logical operator, which was your interesting psychological point. Now you have unpacked your full set of criticisms. (o:

A couple of things attract additional comment from me:

> With perl you have to add all sorts of junk like "use strict;" and "use warnings;"

You named two things, and you call them junk. Maybe you don't recognise that these statements do toggle functionality in a useful way. Perl can be used effectively as a piped-command language. Perl's notation makes it terse and powerful.

> I don't think anyone would compare Python to C or Java.

But you made an argument from popularity. If popularity is to be taken as a rational, enlightened movement, other very important languages have converged on different notation from Python. (If we are still talking about notation and whitespace.) Python's notation is not the most popular, as much as its evangelists insist. Add Go lang to the bigger group as well.

I think Go will devour all the interpreted languages eventually.

> data science (well, R too)

Yes, in this field (data science may be a marketable construct), C++, SQL, R, Python, and Jupyter play the major role. Other languages may offer more in the future. Folks talk about Julia, for example. Perl's PDL has not been adopted as widely. Of course, once you have data, you can science it with any fast, robust tooling. I often use awk and Perl too.

Do you dislike awk and sed as well? I find that common among Python programmers.

> they're both great languages with several warts.

No language made by monkeys is going to be "perfect". Go fmt and perltidy make more sense than building an ecosystem for a personal preference. We both know that bad code can be written in any language.

I use both languages daily. Python has a better threading story despite the GIL. But I can find better tools that don't have Anaconda-size dependencies. (I cannot easily summarise my contempt for pip).

Re:Perl Turns 34 Today by lenkite on Friday December 24, 2021 @06:36AM (#29672761)
"I think Go will devour all the interpreted languages eventually"

This discussion was amusing to read, but I have to butt in days late. Go will not devour any interpreted language without an available interpreter of its own.

Re:Perl Turns 34 Today by 7thaccount on Tuesday December 21, 2021 @05:37AM (#29635999)
Edit: adding here since I can't edit the original article.

I hope the tone didn't come off as condescending or too argumentative. I was just doing my best to essentially say that all software stinks in it's own way (including both Python & Perl). The few times I've reached for Perl over the years, it has worked fine. Some of the issues such as having a fairly primitive OO system out of the box without reaching for Moo or Moose on CPAN are more than addressed with the very advanced Raku (formerly Perl6), but at this point, that's a perl inspired sister language and not a viable upgrade path.

Re:Perl Turns 34 Today by heresie-dabord on Tuesday December 21, 2021 @02:13PM (#29640900)
> a fairly primitive OO system out of the box

I will argue that it isn't primitive, but that it is composable and as lean as you want it to be. If I want a dict with just two methods, I can build it easily and with small memory usage. (This is important when scaling objects into the hundreds of thousands... or more!)

TBH, Perl5 OO is easy and tractable. I would agree that the "bless" artefact is unusual, but it does make sense from the point of view of C structs.

Oh, as far as REPLs go, there are some easy solutions for Perl, from trivial to more complex. Python's REPL is limited because it doesn't handle multi-line structures well. That is in part a consequence of using whitespace as a logical operator.

Re:Perl Turns 34 Today by pkrumins on Saturday December 18, 2021 @07:45AM (#29604078)
We should team up!
Re:Perl Turns 34 Today by HeckFeck on Saturday December 18, 2021 @08:47AM (#29604442)
Certainly, brother. Together we shall bring the Word of Wall to all.

I see a world where /usr/bin/perl will become PID1 and at every system boot will

    mv /usr/bin/python /dev/null
there shall the snake finally be consigned eternally.
Re:Perl Turns 34 Today by zerocount on Saturday December 18, 2021 @09:12AM (#29604592)
While you're at it, get rid of all the Rust, C++, and TypeScript as well. Let the world C the light.
Re:Perl Turns 34 Today by ruslan on Saturday December 18, 2021 @04:52PM (#29608909)
C++ as of '98 is ok. The rest is garbage.
Re:Perl Turns 34 Today by ruslan on Saturday December 18, 2021 @04:43PM (#29608822)
Also screw all Python programmers, what a bunch of losers with their indenting rules and PEPs. Weirdos. Whenever you hear somone say Python is good or interesting, run.)

I applaud this, standing.

Re:Perl Turns 34 Today by Grinnz on Saturday December 18, 2021 @12:00PM (#29606097)
For the record, shitting on other languages does not represent the values of Libera #perl. Though I personally would not use python or PHP, use whatever gets the job done.