21 ms·
Significant features introduced for recent versions of Perl
- Enk1du 3y agoThe very short format is useful for reminders of what is possible, flagging features that I'd skipped over when they first came out (iterating over multiple values at a time, i.e. a hash in a foreach loop). You need to go elsewhere to get the significance of new features to the language, such as "class" or subroutine signatures. It's the best format of reference I've seen for the times I'm asking myself what's the minimum version of Perl needed for this bit of code and what becomes available when ops upgrades the production server.
- wruza 3y agoIn tables without borders and/or margins, you can never tell where each feature starts or if there’s one or two of them when the text wraps. Not sure what drives people to use tables at all for title:content or feature:description lists.
- Thorrez 3y agoEach row has 2 columns. Does the left column ever wrap? I don't see it wrapping because it's pretty narrow. Because the left column never wraps, you can use the left column to determine when a new row begins in both columns.
- jlokier 3y ago> Does the left column ever wrap? Yes, the left column wraps on mobile.
- ikiris 3y agoI appreciate how even the new feature table is as unreadable at a glance as their code.
- casenmgreen 3y agoFWIW, I had no problems reading it. OTOH, a long time ago I used Perl seriously, so I'm familiar with the language.
- petre 3y agoAt least it has no surprises like typeof "" == string false
- WesolyKubeczek 3y agoIt has other surprises, like unexpected list contexts eating your undefs, serializing modules determining whether a scalar is considered numeric or string depending on which reading operation accessed it last, also perpetual uncertainty footgun whether a given string is bytes or unicode by some popular modules.
- kstrauser 3y ago> serializing modules determining whether a scalar is considered numeric or string depending on which reading operation accessed it last I need to hear more about that.
- WesolyKubeczek 3y agoThe darling JSON::XS is doing it. perl -MJSON::XS=encode_json -MData::Dumper -E 'my $d = { foo => 42 }; say encode_json($d); say "foo is $d->{foo}"; say encode_json($d);' Output: {"foo":42} foo is 42 {"foo":"42"} JSON::PP and Cpanel::JSON::XS don't have this bug, but JSON::XS is quite entrenched in some codebases.
- kstrauser 3y agoWhat the hell.
- 3y ago
- deleted 3y ago[deleted]
- throwawaaarrgh 3y agoMan. I really wish we didn't have language discrimination. Perl is just so fast to write and has such a sizeable ecosystem of modules, and such great docs, that I can produce any program in Perl faster than I can write it in Python, purely because it's more expressive in a smaller space and has fewer restrictions. But no team I'll ever be on in my life will agree to work with me on a Perl project, because everyone just "knows" Perl is taboo. People laugh at me when I suggest using it.
- em-bee 3y agothat's not just a perl problem. you may face the same issue with php and also any lesser known language, if only for different reasons. either way though, popularity wins
- smartmic 3y agoThe best thing about Perl in comparison to Python is that programs written in Perl age very well. You can run decades old scripts without any updates, versioning and/or dependency hell or other headaches. Even better, also across platforms. I stopped using Python because of the anti-experiences with all that.
- gbacon 3y agoPerl’s documentation runs circles around Python’s.
- collyw 3y agoWas thinking that sounds strange, but that's because 90% of my Python is done in Django (which has excellent docs). Python's own documentation is horrible to read for some reason. Whenever I need to remind myself of how to use regexes in Python, it's the first place that comes up, followed by finding a tutorial elsewhere.
- burntsushi 3y agoWhat if people don't like Perl for real reasons and not just because of knee-jerk taboo? I've actually written a few Perl programs and I really did not enjoy the experience at all. Its regex engine has good Unicode support, if you can figure out how to enable it. I'll give it that.
- anthk 3y agoPerl5 it's like merging an enhanced ksh, easier awk and less difficult sed in a single tool. It can do the same exact thing as the previous three but with less headaches. Except acting as an interactive shell as sh does, OFC. Also with CPAN you have lots of nice tools out there.
- librasteve 3y agoperl has the distinction of being designed by a linguist and, for many coders (like me), it has a very smooth and easy feeling … … others dislike the idea of $ sigils as “noun” markers and @ sigils to denote plurals but imo these features trick your brain into engaging these natural language concepts. In contrast, I feel that Java is “heavy”, Python is “sciency” and so on. The other distinctive aspect of perl is that it does not seek to constrain and block the coder. Strongly typed and opinionated languages (like Rust and Haskell) can be frustrating since they force you to code their way. That’s fine - it’s in the contract. perl is for when you just want a bag of tools to get the job done without becoming a wrestling match. This flexibility also means that non standard code is easier to write in perl. The tool gets a bad reputation at the hands of poor coding practices. A higher level of trust and self-discipline is needed. perl6 - now renamed to www.raku.org, continues the spirit with a cleaned up syntax and a lot more features in the core language
- washadjeffmad 3y agoSurprisingly (but not really), I found myself in a position to harness my late-90s perl for cgi experience for the sciences after bioinformatics began to take off. Python makes quite a few things easier if only because of how "teachable" it is between colleagues, but the really useful tools that bear more in common with the human relationship with data as text-at-scale were part and parcel to the POSIX-likes. The biggest challenges I faced were getting IT to let me use Linux at work and convincing peers to try it.
- archargelod 3y ago> perl6 - now renamed to www.raku.org, continues the spirit ... With perl7 still being worked on, is it really a continuation or they're just branching off? I'm still not sure what's their relation to each other now. Why would one choose to use perl over raku or vice-versa?
- 7thaccount 3y agoMy understanding is that there is Perl 5 (which is Perl) and a completely separate language known as Raku that was originally supposed to be Perl 6. This happened as Perl 6 took so long (similar to Duke Nukem Forever) that large portions of the Perl community decided it wasn't a realistic upgrade path and the languages had a hard fork. Perl7 seems to be Perl5 with some changes to the defaults. They can't upgrade to Perl6 as that would be needlessly confusing. If foresight were perfect, Perl6 would have always been a different language name so Perl proper would continue without confusion. The problem was that they had no idea how hard it would be to make Perl6 and thus thought it would be ready in a few years (my understanding) and everyone would upgrade. Raku/Perl6 is SERIOUSLY COOL. I think it just needs a larger community and that's a chicken/egg problem.
- csdvrx 3y agoI like perl. Before, I had written a toy web server in perl (it was fun and I learned a lot), then I ported it to cosmopolitan to have it run everywhere! This year I've written a fdisk replacement in perl, to make hybrid MBR+GPT for bootable media. First, I wanted to check how they were made, but then I decided I wanted to programmatically write hybrid MBR in a way that's easier than gdisk and that offers more control that xorriso. It's not complete yet, but the partition reading feature was already very helpful to understand the ins and out of the mfg59 layout that's so popular for optical media, and the final gpt tweaks should only take a few more days. perl allowed me to write it very quickly and to make sure it will work reliably for the years to come.
- kstrauser 3y agoBummer you’d been downvoted for that. It sounds like quite the ambitious project that you’ve nearly got working. Cool! But I’m also saying this while holding a sharp stick and slowly backing away. That is not the sort of thing I’d expect someone to write in Perl, and I’m experiencing an odd mix of “that’s amazing!” and “what on earth were you thinking, my friend?!”
- csdvrx 3y ago> Bummer you’d been downvoted for that. Some people have an instinctual dislike of things they've been told it's fashionable to hate. I resent that, because all programming languages are interesting in their own ways. > It sounds like quite the ambitious project that you’ve nearly got working. Cool! Oh it's already working, it just needs more polish :) Check https://github.com/csdvrx/hdisk https://github.com/csdvrx/hdisk if you're interested Actually, I'll try to submit it! > That is not the sort of thing I’d expect someone to write in Perl, and I’m experiencing an odd mix of “that’s amazing!” and “what on earth were you thinking, my friend?!” I wanted to do it quickly :) For decoding weird formats that mix little and big ending, I think perl unpack/unpack is the fastest way. Also, for computing crc32, I didn't have to bother much :)
- kstrauser 3y ago
- nwatson 3y agoHmmm, I haven't looked at Perl in ten years and my day-to-day for the past seven years has been Python with occasional Java. I was a fan, but now I don't miss Perl.
- collyw 3y agoI feel exactly the same. Perl is a more expressive more fun language, but I do find that the more restrictive nature of Python leads to me writing better, if a bit more verbose code (better as in more readable and maintainable). I would start something in Perl using a few fancy tricks, then come to hate my "clever idea" a few days later when trying to debug it. I do miss it though.
- cwalv 3y agoI know a lot of folks who feel the same way about python (it's too dynamic and encourages unmaintainable code). It's a continuum; to me it's amazing how well python hit the sweet spot.
- LispSporks22 3y agoIf Perl6 hadn’t killed Perl, would we still see it in use today?
- demondemidi 3y agoIt didn’t and we do.
- anthk 3y agoPerl5 it's used in OpenBSD base, and it has pledge and unveil support.
- tasty_freeze 3y agoOver the past 10-12 years, Perl has been getting some significant speed boosts, on the order of 30% overall. It is of course still a very slow language when compared to compiled languages, but I'll take it. https://blogs.perl.org/users/dimitrios_kechagias/2022/11/perl-performance-evolution-over-the-last-decade.html https://blogs.perl.org/users/dimitrios_kechagias/2022/11/per... I still code in Perl a fair bit for work. One great improvement I have taken advantage of is subroutine arguments, rather than unpacking @_ at the head of each subroutine. It is much easier to tell what the sub expects, and if the caller passes the wrong number of args it is a compile time error. The main draw for me is that regex is built into the syntax of the language, and not a library. If the task requires a lot of pattern matching and string manipulation and speed isn't that critical, I reach for Perl.
- temporallobe 3y agoPerl aficionado here - I love Perl for its regex as well. Whenever I need to do serious regex work (log parsing, for example), I pull out Perl. Many of the engineers I’ve worked with also don’t realize that it makes an extremely good shell interaction tool (much more powerful and intuitive than Bash scripting, for example) and I have developed many a TUI with it. I eventually learned Python as well, but always saw Perl as superior in many ways, especially when raw performance isn’t a consideration.
- bloblaw 3y agoPerl's still got a special place in my heart, but honestly, I don't use it much these days. I mainly bring it out when I'm processing a lot of text or writing scripts to be used by Perl-savvy teammates. But here's a cool thing - in coding interviews for non-SWE roles (I'm in security), when they say 'pick any language', I go straight for Perl. Why? Because it's very forgiving when prototyping a solution quickly, has great data-structures without a lot of setup (auto-vivification!), built in grep and map features, etc.
- 1024core 3y ago> when they say 'pick any language', I go straight for Perl. The other good thing is that the interviewer probably won't know it and wouldn't be able to critique your solution ;-)
- 1024core 3y agoPerl was my first love. And I still have warm feelings towards it, just like one does with one's first love.
- seesaw 3y agoMine too. I spent over a decade thinking in Perl. While I have moved on, I still miss Perl, and hope it maintained its relevancy.
- ecef9-8c0f-4374 3y ago10 Years ago there was the so called Perl Renaissance. Which should turn Perl around. Sad truth is. People already moved on. Everything to little to late and not what the people where looking for.
- forinti 3y agoI don't get this line of criticism. Perl is a dynamic language and it gives you a lot of flexibility and allows you to add things you think you need. It's not like Java/Go/Rust where you really have to wait for new syntax in the language. I think maybe whoever thinks like this about Perl shouldn't have been using it in the first place because they needed something different, like a strongly typed language.
- ecef9-8c0f-4374 3y agoApples and Oranges. Php startet as a Perl framework. Ruby is direct reaction to Perls inability to evolve (Perl autobox is great. Why not in core). There is Python. I love Perl. Use it daily. I used Moose, mouse, any::mouse and was excited about p5-mop. But there is no traction in change. Also fact is Perl has a bad image and Perl gets patched out of all projects.
- darrenf 3y ago> Php started as a Perl framework This isn't true. PHP/FI was written in C. Here's Rasmus announcing it to the world in 1995: https://groups.google.com/g/comp.infosystems.www.authoring.cgi/c/PyJ25gZ6z7A/m/M9FkTUVDfcwJ?pli=1 https://groups.google.com/g/comp.infosystems.www.authoring.c...
- forgotmypw17 3y agoI started a new Perl project 7 years ago and it has been an ecstatic experience for me. It is basically a text processor and HTML generator, so Perl has all the features I need. I am so happy, and I'm not even using anything beyond 5.010. I'm at 32K+ LOC now, and I'm also using the project to teach programming to Ukrainian kids over Zoom. Number of breaking changes I have experienced in these 7 years? 0. Number of times I've had any significant issues setting up a new deployment? 0. It may not be as popular, but it certainly continues to work well.