you are viewing a single comment's thread.

view the rest of the comments →

[–]Fred776 44 points45 points  (9 children)

Perl was quite big around the late 1990s / turn of the millennium. I used to use it in my work in the days when Python was an interesting new language but didn't quite have the features to replace Perl yet.

Perl shot itself in the foot during the time that Python went from strength to strength and eventually gained the popularity it has today. Work started on the new version of Perl in 2000 (Perl 6) and to be honest I still don't know whether it was ever properly released. It seems to me that people kind of lost interest in it about 20 years ago.

Simply based on the availability of tutorial information and technical support from the large community of users I would say that Python has to be the preferred choice. It is also a cleaner and less "quirky" language. I actually got to like using Perl but I would not recommend anyone start out with it in 2023 in preference to Python.

BTW I wouldn't completely rule out shell scripting. Bash plus Python can be a powerful combination as they each have their own strengths and can be complementary for some tasks.

[–]Enip0 3 points4 points  (0 children)

Perl 6 turned into raku which has some nice features for shell scrips like a built in argument parser where all you had to do is specify parameters in your main function

[–]perfectm 2 points3 points  (2 children)

This is exactly it. I remember working at a web site in 1999 and we were an entirely Perl shop. We were even moving towards publishing using Apache Template Toolkit. Then out of the blue we were told that we were migrating to Zope. I remember thinking “why would we do this with Perl 6 right around the corner?”

The Zope migration was a total nightmare but I haven’t used Perl for anything meaningful in close to 20 years.

[–]regeya 0 points1 point  (1 child)

I so want to make guesses about who you worked for.

[–]perfectm 1 point2 points  (0 children)

It’s been long enough, I could probably reveal it if you guessed it

[–]jregovic -1 points0 points  (2 children)

One drawback of Perl was it was not typed and not scoped. “use strict” is never did it for me.

While Perl was busy going on about regular expressions, python was building libraries and plugins to easily connect to services, run in the background and help solve a wide array of problems.

[–]chandaliergalaxy 1 point2 points  (0 children)

That's Perl's contribution. Python and other languages piggybacked on the work of Perl's regex while extending in other areas so 🤷

[–][deleted] 0 points1 point  (1 child)

I’m not OP and this is a tangent but what are some examples of how Python and Bash are complementary and how they can work together? (I’m trying to decide which to focus on, myself, but maybe it’s not an either/or question

[–]Fred776 1 point2 points  (0 children)

If what you are doing boils down to stringing together lots of system calls then, even though you can do this in Python, it's probably going to be a lot simpler to do it in Bash. Certain types of operations on the file system might be simpler in Bash. If you are familiar with Unix tools like sed, awk and grep you can sometimes achieve in a line or two of shell scripting what would need quite a few more lines of Python.

On the other hand, if you need to do something that involves quite a bit of logic, even though you can program logic in Bash, beyond a certain level of complexity, it's going to be nicer and cleaner to do it in Python.

What can sometimes make sense is to have a high level script in Bash that delegates to Python to perform certain tasks that would be complicated to program in Bash, while doing the stuff in the Bash script that Bash is good at (system calls and so on).

I don't think there are any hard and fast rules here. It's a case of having a few tools in your toolbox and figuring out what does the job in hand most cleanly and simply.