TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Not Your Grandfather’s Perl

321 pointsby djha-skinover 2 years ago

42 comments

forgotmypw17over 2 years ago
With function signatures and state variables added in 5.010, I consider Perl feature-complete and have not really missed anything from it for as long as I&#x27;ve been writing Perl.<p>What I do appreciate that&#x27;s missing from many other languages and systems is the extreme committment to backwards compatibility. The knowledge that the next minor release won&#x27;t break existing scripts is underrated, IMO.<p>Solo project with ~23K LOC of Perl and counting here. Bless you, Larry Wall and Perl maintainers. Keep it up!
评论 #32771913 未加载
评论 #32773098 未加载
评论 #32767787 未加载
评论 #32768822 未加载
评论 #32768006 未加载
评论 #32768737 未加载
评论 #32770528 未加载
评论 #32787045 未加载
评论 #32768287 未加载
评论 #32775434 未加载
评论 #32775379 未加载
ra88itover 2 years ago
When I was about 20, I went to the local Barnes and Noble to find a book about programming.<p>Picked up the O&#x27;Reilly Javascript book from around 2000. Had no idea what javascript was, just wanted to learn how to program and trying to pick the most popular language.<p>$40 later, I got home and started reading! Very confusing, the first half of the book covered the language runtime (I think?) and the second half covered the browser sandbox, and it took me 200 pages to realize that I can&#x27;t easily read or write to files on my machine with this language. Not what I was hoping for!<p>Back to Barnes and Noble, another $40 and I came home with the O&#x27;Reilly camel book, Beginning Perl I think? Cover to cover read, probably the last time I did that with a programming manual.<p>Decades have passed, I&#x27;m in the same camp as those that prefer Ruby now, but man what a breath of fresh air Perl was back in 2000.
评论 #32775724 未加载
评论 #32775558 未加载
CraigJPerryover 2 years ago
I don’t really miss perl. I do miss the period when perlmonks was relevant to me. I haven’t really seen a similar community since. Maybe rose tinted spectacles on my part but i learned some really enlightening algorithms on there specifically in text processing and i recall it being a really warm community.<p>Randall Schwarz used to run a podcast that was a total goldmine. Fond memories of listening to that on the train on the way to work.
评论 #32771754 未加载
评论 #32778338 未加载
HeckFeckover 2 years ago
It&#x27;s not objective, but I find I have more fun in Perl than any other language. The initial jump was steep, but it helped that I already knew some shell. Now I think in references, I can guess what $_ is going to be, I slap in a big, my $val = s&#x2F;&lt;RE_HERE&gt;&#x2F;other_thing wherever I want, I could go on!<p>I think $_ belongs to a different era, before levelling everything to the lowest common denominator became seen as a good thing. I found the limitations of its rivals less than compelling, and besides JavaScript is arguably <i>more</i> complex than Perl these days.
评论 #32774541 未加载
评论 #32770879 未加载
HankB99over 2 years ago
I&#x27;ve used Perl off and on throughout my career, even working at one job that was pretty much exclusively Perl. I&#x27;ve also used Java and C&#x2F;C++. I&#x27;ve done a lot of work with embedded systems where C was the order of the day.<p>But back to Perl. I always thought one of the best things about Perl was CPAN. I could nearly always find a module that would accomplish a specific task I needed and then I was just left to write the glue to implement that function (or functions) for my particular needs. I&#x27;m surprised CPAN is not mentioned. I wonder if it is still active. I also wonder about security of CPAN in todays environment. I find stuff like pypi and npm to be pretty scary.<p>I haven&#x27;t started anything in Perl in quite some time. All the cool kids are using Python so I&#x27;ve been sharpening my skills with that. (But it&#x27;s all hobby projects these days.)
评论 #32771404 未加载
评论 #32772031 未加载
评论 #32775978 未加载
评论 #32775581 未加载
0xbadcafebeeover 2 years ago
I still use Perl whenever I need to get something complex done quickly. Whether it&#x27;s the handy command-line switches and features for easier one-liners, or just easier stream text processing, or easier external command execution, or the huge library of modules that often support things Python doesn&#x27;t, Perl is my &quot;fuck it, I just need to get this done&quot; language.<p>I can&#x27;t wait for the day that programming languages as a concept are obsolete. It feels exactly like hand-tool woodworking. I would love to stop building tables and chairs over and over, instead just buy them from Code IKEA.
评论 #32774513 未加载
LordKanoover 2 years ago
When I was an intern, my boss insisted that I learn Perl. I had not yet been introduced to the ways of the monks but I learned quickly.<p>Perl is still my go-to language when I need to write something quickly.<p>I have so many purpose driven utilities that I have written in Perl, that it saves me several man-hours of work every month.
wistloover 2 years ago
&quot;Bare bones&quot; seems to be a good thing for Perl. I use Strawberry Perl on Windows and it is orders of magnitude faster than Powershell for processing large files of text strings using regular expressions.<p>I hope the addition of a &quot;new object-oriented programming framework&quot; won&#x27;t take away the &quot;bare-bones&quot; speed of the current release.
评论 #32769963 未加载
评论 #32775757 未加载
评论 #32768268 未加载
cutlerover 2 years ago
Perl enabled me to take a business-owner&#x27;s disorganised national spreadsheet of teachers, locations and contact details and turn it into a web application, freeing him from fielding phone calls all day and boosting conversions over a period of 15 years. Perl&#x27;s superb regex handling was essential in extracting and gradually refining the data until it was fit to be entered into a database. From that point on Perl, along with PostgreSQL, literally ran the business while generating opportunities for hosting promotions with bigger companies. Those who (m|kn)ock Perl usually haven&#x27;t spent a significant amount of time using it to add real value to a business.
JackFrover 2 years ago
Maybe I’m missing the point of this piece, but it’s probably because I’m still reeling from the author’s idea that adding “say()” which is “print()” with a newline added, is somehow an improvement to the language.
评论 #32768901 未加载
csdvrxover 2 years ago
Even on modern hardware with vectorization, the speed of perl is hard to match for stream processing.<p>I write and deploy brand new perl code in 2022 to replace some clunky python and javascript - for real! AMA!
评论 #32768222 未加载
评论 #32768298 未加载
评论 #32768289 未加载
评论 #32767942 未加载
评论 #32775448 未加载
xani_over 2 years ago
Uh,those features are here for almost decade now, some longer IIRC.<p>But man, just being able to write<p><pre><code> use v5.10 </code></pre> have been a blessing when you need to support some legacy infrastructure. Old Python broke after upgrades, Ruby broke, but Perl code keeps on trucking.<p>In vast majority of cases the code changes were just &quot;well, the new version of lib gives some warnings about deprecation, might as well clean it up a bit&quot;. The minority of cases has been Mojolicious breaking stuff again.
ksherlockover 2 years ago
Please don&#x27;t blame bare word file handles on &quot;C heritage&quot;<p>--<p>Some of the improvements were needed because in places Perl’s Unix&#x2F;C heritage shows through a little more than we’d like it to in the 21st century. One good example of this is bareword filehandles. You’re probably used Perl code to open a file looking like this:<p>open FH, &#x27;filename.dat&#x27; or die;
评论 #32770885 未加载
mikejulietbravoover 2 years ago
Perl receives such an unnecessary amount of hate
评论 #32770802 未加载
评论 #32770459 未加载
评论 #32772335 未加载
ibizaover 2 years ago
The thing that kills Perl for me is its weak typing. Automatic variable coercions lead to data-dependent bugs. JavaScript has the same problem.<p>For scripting anything longer than a command line, I&#x27;ll take Python.
pmontraover 2 years ago
Thumb up for function signatures!<p>I slowly switched from Perl to Ruby for writing my own text processing scripts. A loop with &lt;&gt; is very convenient but I was using Ruby for work (still do among other languages) and Perl for nothing. I was forgetting how to do stuff in Perl.
gyulaiover 2 years ago
So, this is on the stack overflow blog. And Joel Spolsky famously thinks that to rewrite a codebase from scratch is the &quot;single worst strategic mistake that any software company can make&quot; [1].<p>I wonder if this is how you end up being a Perl user in 2022.<p>[1] <a href="https:&#x2F;&#x2F;www.joelonsoftware.com&#x2F;2000&#x2F;04&#x2F;06&#x2F;things-you-should-never-do-part-i&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.joelonsoftware.com&#x2F;2000&#x2F;04&#x2F;06&#x2F;things-you-should-...</a>
评论 #32779463 未加载
superkuhover 2 years ago
I&#x27;d argue perl&#x27;s major value is from stability in the sense that what the perl developers write today can be run on the perl available on any machine, new or old. If a lot of perl developers end up use&#x27;ing lots of these new features that feeling of compatiblity will go away.
评论 #32768106 未加载
SighMagiover 2 years ago
Gives me warm fuzzies to read new Perl articles. Such a fun, hackable and eminently practical language.
calvinmorrisonover 2 years ago
I wish there was a callout to Modern::Perl;<p><pre><code> use Modern::Perl; </code></pre> and you get the lot of those features.
评论 #32775779 未加载
robotguyover 2 years ago
Probably not the place to ask, but some of you might find this interesting enough to take pity on me.<p>I had an idea years back to build crosswords on the surface of a truncated icosahedron (<a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;qlLl434.jpg" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;qlLl434.jpg</a>) but I had no idea how to find sets of 5-letter words that would mesh like that. A very clever programmer friend of mine whipped something up in Perl over a weekend using hashes. Basically it pre-emptively runs through the dictionary and hashes all wildcard forms of a word back to the original word (l...s-&gt;leaks, etc), then at each stage of filling out the puzzle it just grabs the list of words that hash to the current pattern. Say you&#x27;re looking for something that fits s..p. it would return [stops, swept, soupy] etc, then tries each recursively. If the list is empty, there is no solution at that level so it backs up and tries the next word at the previous level.<p>I learned enough Perl to be able to make the code able to accept different polyhedra. The program takes quite a while to run on larger models, like say the rhombicosidodecahedron, so I&#x27;ve been looking for ways to speed it up. My background is with assembly and embedded C so I&#x27;m sure my implementation of these hash lookups would be slower than Perl&#x27;s. Are there any other, maybe compiled, languages that have fast hash lookups like this?
xyzzy4747over 2 years ago
I used a lot of Perl at various jobs.<p>Nowadays I have my own startup and my code is a mixture of JavaScript, TypeScript, and Rust.<p>Rust is good for anything sufficiently complex that you want to run quickly, have a small footprint, and want to be sure it works, while allowing for easy refactoring due to the strong type safety.<p>JavaScript is good for anything you want to write quickly and the code quality doesn&#x27;t matter as much (e.g. test scripts). It&#x27;s also much easier to write than Perl syntax-wise and has great async support (unlike Perl). Also it has a much larger ecosystem of libraries and easy to use in IDEs like VSCode. Obviously JS&#x2F;TS can also be used in both the frontend and backend which is another big advantage.<p>TypeScript is sort of in between - if the JS codebase gets too large it should be written in TS instead. This makes the code less &quot;write-only&quot;.<p>Perl and PHP were pretty good solutions as scripting languages until JS added good async&#x2F;await support, map&#x2F;filter&#x2F;reduce, and destructuring syntax in my opinion. JS probably requires the least lines of code to get a program working.
balthigorover 2 years ago
PERL was the duct tape of the early Internet. Remember CGI scripts in PERL on FreeBSD? Good Times.
评论 #32774128 未加载
评论 #32775852 未加载
cheaprentalyetiover 2 years ago
Damn Pythonistas! Get off my lawn!
评论 #32768463 未加载
评论 #32768361 未加载
评论 #32770447 未加载
jlv2over 2 years ago
I spent the last 16 years of my career using Perl for about half of what I wrote.<p>And I read the article.<p>The title makes no sense. The article show anything meaningful as to why Perl has improved and is &quot;not your Grandfather&#x27;s Perl&quot;. Most of what the article talks about has been around for over a decade. If anything, it shows that Perl really still has under it the same old decrepit beast it always been hiding away.
评论 #32771948 未加载
johnmc408over 2 years ago
Looking forward to v7 and intro docs that only use &quot;even more&quot; Modern Perl. For a bigger push, we should all volunteer on those &quot;Do X in Y&quot; language sites and add Perl examples. Same with Amazon Lambda and other opportunities where pick your language is available.<p>Also a modern OO seems nice, though not sure what is in it. Would also like to see a default async library (maybe POE, but I never used it and find the name a bit strange for a default...but then I like Tokio...) Not my area at all, but an opinionated way of async seems nice.
garfieldnateover 2 years ago
I&#x27;m surprised with the emphasis on new features that such old features were highlighted. The &#x27;say&#x27; function was added in 2007. Signatures were added in 2014, though to be fair they didn&#x27;t stop emitting an &quot;experimental&quot; warning until this latest release.
aurahamover 2 years ago
I skimmed the article looking for a mention of a REPL or a new debugger. Perl is a great language but it lacks these tools. Sometimes I just want to try a couple of lines of Perl code in a REPL, but I cannot. Instead, I need to create a file. Also, when debugging with `perl -d`, I cannot use the Up arrow key to get the previous command. Not a big deal but the coding experience will be significantly improved with those tools.
评论 #32780325 未加载
评论 #32777058 未加载
评论 #32773384 未加载
评论 #32785450 未加载
评论 #32777133 未加载
fijiaaroneover 2 years ago
I’m so looking forward to learning Perl 7 and all its quirks with<p><pre><code> my ($grandchildren) = @_</code></pre>
mgraczykover 2 years ago
Spent about 4 weeks learning perl at an internship 10 years ago. I believe that is one of the biggest professional mistakes I ever made. There is literally nothing I would recommend doing with perl over python.
评论 #32773645 未加载
评论 #32803881 未加载
alxmdevover 2 years ago
I think of Perl as a Python-PHP hybrid. A pragmatic product of its time that will endure, and while I&#x27;m grateful for never needing it, I&#x27;m glad that it&#x27;s a solid option still for those who do.
评论 #32774079 未加载
评论 #32774353 未加载
raggiover 2 years ago
This is the readability of the Perl in the blog, captured on my system: <a href="https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;EJFNO2U" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;EJFNO2U</a>
publicola1990over 2 years ago
Is it now a fully featured language in which to write any program? Does it have a networking stack? What about GUIs? What about numerical stuff?
xivzgrevover 2 years ago
Perl was created in 1987. My grandpa isn’t that young!
tomcamover 2 years ago
Love the title. It also made me remember that my grandparents were born in the 1890s…
brazzyover 2 years ago
&gt; $time-&gt;mon # 1 - 12<p>&gt; $time-&gt;month # Jan - Dec<p>&gt; $time-&gt;wday # Sun = 1, Sat = 6<p>&gt; $time-&gt;day # Sun - Sat<p>Seriously?
jasonm23over 2 years ago
Hmmm ... It is a useful stand in for sed.<p>For everything else, there&#x27;s anything.
pkruminsover 2 years ago
I love Perl!
评论 #32767940 未加载
orfover 2 years ago
Sorry, but what? The top features they highlight here are a print statement that adds a new line, a change to the bonkers default of creating some kind of implicit global named variable every time you open a file, representing time as an object (with a strftime function!) and… function signatures?<p>I wouldn’t call this as “Perl moving forward”, I’d call this “Perl is still about 20 years behind everyone else”.<p>Wait until they find out that other languages print statements let you customise the line ending!
评论 #32772872 未加载
评论 #32770768 未加载
评论 #32770833 未加载
评论 #32771010 未加载
评论 #32771073 未加载
thesuperbigfrogover 2 years ago
The current state of Perl 5 for Python fans:<p>Perl 5: I&#x27;m not dead!<p>TIOBE: &#x27;Ere! &#x27;E says &#x27;e&#x27;s not dead!<p>Internet: Yes he is.<p>Perl 5: I&#x27;m not!<p>TIOBE: &#x27;E isn&#x27;t?<p>Internet: Well... he will be soon-- he&#x27;s very ill...<p>Perl 5: I&#x27;m getting better!<p>Internet: No you&#x27;re not, you&#x27;ll be stone dead in a moment.<p>TIOBE: I can&#x27;t take &#x27;im off like that! It&#x27;s against regulations!<p>Perl 5: I don&#x27;t want to go off the chart....<p>Internet: Oh, don&#x27;t be such a baby.<p>TIOBE: I can&#x27;t take &#x27;im off....<p>Perl 5: I feel fine!<p>Internet: Well, do us a favor...<p>TIOBE: I can&#x27;t!<p>Internet: Can you hang around a couple of minutes? He won&#x27;t be long...<p>TIOBE: No, gotta get to Reddit, they lost nine today.<p>Internet: Well, when&#x27;s your next round?<p>TIOBE: Next year.<p>Perl 5: I think I&#x27;ll go for a walk....<p>Internet: You&#x27;re not fooling anyone, you know-- (to TIOBE) Look, isn&#x27;t there something you can do...?<p>Perl 5: I feel happy! I feel happy!<p>=====================<p>You can write Perl in Latin: <a href="https:&#x2F;&#x2F;metacpan.org&#x2F;dist&#x2F;Lingua-Romana-Perligata&#x2F;view&#x2F;lib&#x2F;Lingua&#x2F;Romana&#x2F;Perligata.pm" rel="nofollow">https:&#x2F;&#x2F;metacpan.org&#x2F;dist&#x2F;Lingua-Romana-Perligata&#x2F;view&#x2F;lib&#x2F;L...</a><p>or Klingon: <a href="https:&#x2F;&#x2F;metacpan.org&#x2F;pod&#x2F;Lingua::tlhInganHol::yIghun" rel="nofollow">https:&#x2F;&#x2F;metacpan.org&#x2F;pod&#x2F;Lingua::tlhInganHol::yIghun</a><p>or whitespace: <a href="https:&#x2F;&#x2F;metacpan.org&#x2F;pod&#x2F;Acme::Bleach" rel="nofollow">https:&#x2F;&#x2F;metacpan.org&#x2F;pod&#x2F;Acme::Bleach</a>
评论 #32769335 未加载
评论 #32769243 未加载
评论 #32771082 未加载
samiam_iamover 2 years ago
My grandfather was too smart to use Perl.
mansilladevover 2 years ago
As if Perl already didn&#x27;t have a bad reputation for readability, that black or dark gray text in that &lt;code&gt; blocks.. phew.