7 ms·
The funny thing is Perl is now arguably more obsolete than sed and awk.
by aportnoy 3y ago
The funny thing is Perl is now arguably more obsolete than sed and awk.
- jph00 3y agoThat might be true culturally, but it's not true technically. Once you know a bit of Perl (including some command line switches like -e, -n, -a, -l, -p, and -i) you will be able to do just as easily everything you used to do in awk and sed, but with a more powerful foundation so you have the flexibility to go further.
- imiric 3y ago> but with a more powerful foundation so you have the flexibility to go further. The question is: should you? I like Perl, but it itself has many warts that make maintaining a large codebase more of a nightmare than using C, and certainly more than most modern languages. I agree with other commenters here that the tools Perl sought to replace are still used more than it. It has its niche of being excellent at text processing, and more capable than shell scripts at that task, but I'd think twice about reaching for it to build anything more complex than a shell script replacement. Especially in 2023.
- whateveracct 3y agoWhat's a good resource to be proficient in perl for shell scripting? I write a lot of bash for better or worse. I wonder if perl would be a better choice sometimes.
- 878654Tom 3y agoIf you can't manage it with Shell scripting you should take a look at Python. I've written Perl for many years but in the end switched to Python because the internet and resources you can find are much more quantitative and qualitative than those for Perl. Especially now when Google doesn't seem to return older results anymore.
- cutler 3y agoWorse Is Better syndrome.
- whateveracct 3y agoI'd rather write perl tho
- cutler 3y ago"Minimal Perl" by Tim Maher is unrivaled for this.
- kagevf 3y agoThank you for mentioning that book - I'm very interested in how perl can replace awk and sed and even grep(!) - I use grep multiple times a day, awk maybe a few times a week, and sed very rarely. I think I'm in the target demographic for this :)
- version_five 3y agoMy first thought when I saw this was that I'd like to see some stats on use of the three. I personally use sed and awk regularly and never perl, but I have no idea what is typical. I have a feeling that most people (amongst those who may have a use case) don't use any of them.
- SoftTalker 3y agoYep I responded in another comment but I use sed and awk almost daily but I never learned Perl. It's actually something that could be useful in my current role though -- is there a particularly good intro to Perl in 2023 that I might want to look at?
- djbusby 3y agoThe wonderful thing about Perl is the docs from 2013 are still valid. All the growth/rapid-change/package-management issues that newer ecosystem suffer through Perl did in like the late 90s. 20 year old code still works (mostly). Not nearly the churn (anymore) as JS or PHP or Go or Rust.
- idlewords 3y agoThe Perl man pages are really good! Start with "man perlintro" and then look at whatever sections in the "man perl" table of contents fit your needs. A lot of the tutorials online in my opinion are overbaked and written for people writing large OO projects using a lot of scaffolding. But the man pages were originally targeted at sed and awk users in your position.
- SoftTalker 3y agoSounds perfect, thanks!
- explaininjs 3y agoGoogle Trends has sed crossing over perl about 5 years ago. Awk seems insignificant, which matches my expectation. (I’ve used sed but never awk, I don’t even know what it does) Worth noting “sed” is “thirst” in Spanish, which has the potential to throw off the data, especially worldwide. https://trends.google.com/trends/explore?date=all&geo=US&q=perl,awk,sed&hl=en-US https://trends.google.com/trends/explore?date=all&geo=US&q=p...
- shrubble 3y agoIt's still used heavily for internal processes and internal web sites that query databases etc. At least at some of the large publicly traded companies I know about...
- zeroonetwothree 3y agoI use Perl scripts dozens of times a day but I rarely write new code in it. awk and sed I use less often but it’s almost always ad hoc new scripts.
- pipeline_peak 3y agoUnix was always about tools doing one thing. Obviously awk and sed didn’t do one thing only, but Perl broke away from that entirely. Perl tried to replace awk, sed, and the shell all at once. The problem with Perl is it was still tied to Unix culture to compete with Python and it’s strong library set, so it was pretty much fazed out as an awkward intermediary.
- golergka 3y agoDoesn't booking.com still run on it?
- colejohnson66 3y agoAnd cPanel (used by many web hosts)?
- edgyquant 3y agoThats a name i haven’t heard in years
- smueller1234 3y agoYes, though not exclusively anymore.
- rawleyfowler 3y agoYes. Actually a lot of companies still run on it. Booking.com, Fastly, ByteMark, OpenCage, I even know of a few startups that run on Perl.
- idlewords 3y agoMy livelihood depends on a large set of Perl scripts, and I bet I'm not the only one in that position. It's perfect for gluing things together and then not breaking for decades, while other languages come and go. It's kind of the new COBOL that way.
- macintux 3y agoI’d love to eventually settle into retirement by maintaining some unloved Perl.
- djbusby 3y agoI make money off "old" systems; I'm spending time with Perl too. Lots of legacy systems out there.
- cutler 3y agoWhich languages are most common in these systems?
- djbusby 3y agoWell, I'm not sure about everywhere but, the work I'm finding is ASP3.0 (IIS6.0) and VB6 (more rare) also Perl and PHP. Many of these projects were started in the late 90s. They are internal systems (billing automation, internal work-tracking, custom "ERP"). Nothing exciting, just old shit that makes money in a non-tech business. I find the work on LI, and I show up when folk search for these olds skills. But I know a few others in this "maintenance" space. One just does legacy Java, one just does old Windows (NT4, 2000), etc. Generally we find work from each other. Additionally, I think it's hard to enter the "Legacy" space. You have to un-learn some patterns, lots of: oh yea, we used to do this the hard way. The other bump is the documentation - the 1999 docs are buried under the 2009 docs which are decaying under the 2019 docs. The thing called ActiveRecord for example means like 99 things.
- cutler 3y agoDo you find any of these legacy system clients are open to having their system upgraded to a modern version of the same or related language, eg. .Net for ASP? After all, it wouldn't involve a significant change in the business logic and most esablished languages are more or less backwards compatible.
- waynecochran 3y agoI use Perl all of the time. If I am going to write a bash script that is more than 12 lines long I use Perl or if I need to do read text files and do regex matching things I haven't found anything better.
- globular-toast 3y agoThere's a difference between using something because you want to and using something because you have to. awk and sed are sometimes the right tool, just not always. When I used sed and awk a lot I also made heavy use of bash which makes things a lot nicer. And Python, of course.