[HN Gopher] Significant features introduced for recent versions ...
___________________________________________________________________
Significant features introduced for recent versions of Perl
Author : asicsp
Score : 120 points
Date : 2024-02-02 10:33 UTC (1 days ago)
(HTM) web link (sheet.shiar.nl)
(TXT) w3m dump (sheet.shiar.nl)
| ecef9-8c0f-4374 wrote:
| 10 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 wrote:
| I 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 wrote:
| Apples 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 wrote:
| > _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.c
| om/g/comp.infosystems.www.authoring.c...
| forgotmypw17 wrote:
| I 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.
| Enk1du wrote:
| There's some nice stuff in the new features and everybody has
| their favourites. Some like the subroutine signatures, but
| I'm a big fan of the hash slices and postfix dereferencing in
| v5.20.
|
| https://www.effectiveperlprogramming.com/category/perl/new-f.
| ..
| wazoox wrote:
| Yep. The fact that 100% of the code I've written in Perl
| since the beginning of this century still works just fine
| year after year with each new release is an immense bonus. I
| have deployment scripts written on Debian 3 still running in
| cron "as is" 20 years later, zero maintenance. Try that with
| Python, PHP or Ruby...
| csdvrx wrote:
| That's what I liked about Windows too. I had to move to
| Linux, but with wine I know I will able able to use some
| binaries forever.
|
| If I write something that I plan to reuse or need again
| later, I will write it in perl
| SomeoneFromCA wrote:
| You may like Haiku, which maintains backwards
| compatibility with ancient beos while still being posix
| system.
|
| Never used it myself, just repeating what heard.
| halayli wrote:
| I don't know why you're being downvoted. It's the truth. Back
| in the 90s many of us invested hundreds of hours mastering Perl
| and post 2008 ended up using Python/Ruby/etc more frequently
| for various reasons and now speaking for myself I can barely
| decipher a line of Perl. It's syntax is extremely hard to
| maintain in memory when you stop using it.
| em-bee wrote:
| if people leave perl because of the syntax then a perl
| renaissance was not going to stop that. the change that had a
| chance to make the syntax more attractive was perl 6/raku.
| gbacon wrote:
| Example?
| kstrauser wrote:
| For me, it was the argument passing syntax. I had to look
| up the magic sigil for doing hashref stuff every single
| time.
|
| One day I tried Python, learned that everything is passed
| by object reference, and set Perl aside and never looked
| back. There was so much less mental overhead that Perl
| never lured me back.
| ecef9-8c0f-4374 wrote:
| There was an experimental auto-deref feature since Perl
| 5.14 And it's already gone again since 5.24.
| chromatic wrote:
| That's because it didn't work reliably. There were at
| least a couple of situations where Perl would have had to
| guess which operation you were trying to perform, so the
| feature was a source of potential bugs.
| Enk1du wrote:
| The 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 wrote:
| In 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 wrote:
| Each 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.
| ikiris wrote:
| I appreciate how even the new feature table is as unreadable at a
| glance as their code.
| casenmgreen wrote:
| FWIW, I had no problems reading it.
|
| OTOH, a long time ago I used Perl seriously, so I'm familiar
| with the language.
| petre wrote:
| At least it has no surprises like typeof "" ==
| string false
| WesolyKubeczek wrote:
| It 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 wrote:
| > 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 wrote:
| The 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 wrote:
| What the hell.
| chromatic wrote:
| It's a language implementation gotcha, not really a
| library problem. The internal data structure used to
| represent values is polymorphic and uses flags to
| represent the types of operations performed on the
| represented data (numeric, string, etc).
|
| The only reliable way to serialize a value with a desired
| type is to request that type explicitly--as one might do
| to represent a large integer or very precise decimal in
| JavaScript or JSON, for example.
| WesolyKubeczek wrote:
| Well, JSON::PP and Cpanel::JSON::XS don't have this
| problem _somehow_.
|
| The fact that they need to literally fortune-tell from
| Perl guts if something is a number or a string is telling
| as literally every other mainstream language including
| current dialects of Pascal has this problem solved. But
| I'm most unimpressed by the fact that merely _looking_ at
| a variable will mutate its internal representation enough
| for there to be externally-visible effects.
|
| It doesn't matter if JSON::XS is looking at the internals
| wrong, or if it's Perl's behavior at fault: from
| whichever angle you look at it, the whole thing is a
| tangled mess of wrongness.
| chromatic wrote:
| _JSON::PP and Cpanel::JSON::XS don 't have this problem
| somehow._
|
| From my reading of the documentation of the former
| (especially the MAPPING section), it has the same problem
| for the same reasons.
|
| _the whole thing is a tangled mess of wrongness_
|
| Perl has monomorphic operators and polymorphic values.
| Every time someone tries to flip that, whether encoding
| arbitrary data structures to monomorphic values via a
| polymorphic visitor pattern, the smart-match experiment,
| or (as I already mentioned in this story's comments)
| polymorphic operators for data structure dereferencing,
| these problems occur.
|
| Regardless of whether anyone believes that Perl's
| operator/value design is good or useful, that's how the
| language works. Working at cross purposes is an exercise
| in frustration. (I'll leave analogies about duck typing,
| contravariance, casting, and type erasure to people who
| like debating programming language design.)
| librasteve wrote:
| raku -MJSON::Fast -e 'my $d = {foo => 42}; say to-
| json($d); say "foo is $d<foo>"; say to-json($d);'
| {"foo": 42} foo is 42 {"foo": 42}
|
| fwiw: raku has cleaned this up
| eviks wrote:
| Wow, indeed, what a bad way to structure a table
| Enk1du wrote:
| It's just a reference list for the people who know half the
| features already. If you want a readable list, try the Table
| of Contents in "Perl new features".
|
| https://leanpub.com/perl_new_features
| eviks wrote:
| that's not an excuse for poor formatting, especially when
| not breaking just a couple of formatting rules would make
| it a better reference, and doing a couple of more tweaks
| would make it an even better reference (e.g., you could
| easily see all experimental features with a simple tag in a
| column instead of having to reach the end of each
| description)
| kstrauser wrote:
| NB: that's not a perl.org website. It's someone's blog.
|
| Now, I have touched Perl in decades (oof, that's rough to type)
| and that someone might be the official Perl leader for all I
| know. I don't think it is, though.
| rabbits77 wrote:
| There really is no Perl Leader these days.
|
| The language is run by a "steering committee".
|
| The community has a couple of shining stars such as Mohammad
| Anwar who runs The Weekly Challenge
| https://theweeklychallenge.org/ and Gabor Szabo
| https://perlmaven.com/about
|
| They are also both co-editors of the Perl Weekly
| https://perlweekly.com/
|
| The Perl Foundation co-ordinates activities such as grants
| funding development, fundraising, and conference organizing.
| https://www.perlfoundation.org/
|
| There are also a few senior Perl personalities still around
| such as brian d. foy who continue to write and update books
| and blogs.
|
| The post-Larry Wall community seems to be doing ok so far.
| What is notably missing is more active participation from
| companies making the most use of Perl such as Craigslist or
| Duck Duck Go.
| fuzztester wrote:
| Wonder if chromatic is still involved with Perl.
| chromatic wrote:
| I am. I released a new version of the Modern-Perl library
| a couple of weeks ago (apropos of this story).
| throwawaaarrgh wrote:
| Man. 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 wrote:
| that'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 wrote:
| The 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 wrote:
| Perl's documentation runs circles around Python's.
| collyw wrote:
| Was 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 wrote:
| What 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.
| kstrauser wrote:
| I'm with you there. I don't hate Perl. I don't think it's
| taboo. I just can't think of a scenario where I'd want to use
| it over another tool.
|
| Perl was the first non-C language I wrote significant amounts
| of Unix code in. In particular, I wrote lots of web and
| server admin projects with it. I know Perl well enough to 1)
| appreciate why people still like using it, and 2) not want to
| use it myself.
| BrandoElFollito wrote:
| I used to write in Perl 20 years ago. It started really nice,
| with well-structured code.
|
| And then when I learned this and that, the code started to be
| more concise, to the point of being impossible to understand
| for the author (me) after a week.
|
| I liked it though and I realize that this is not Perl's fault
| but mine. Still, giving too much power to less experienced devs
| without having them unlock some kind of experience badge is
| dangerous :)
| weare138 wrote:
| I remember those days. Luckily modern Perl has features now
| to help keep you from shooting yourself in the foot.
| WesolyKubeczek wrote:
| > has such a sizeable ecosystem of modules
|
| They say junkyards have a sizeable choice of car parts, too.
| collyw wrote:
| Perl usually had excellent quality modules back when I was
| using it. Python (these days) has a mix of mostly good, but
| some bad. Javascipt just seems a shambles when I go there.
| WesolyKubeczek wrote:
| The thing is, they stayed the same, same 13 years old bugs,
| sometimes you can even see the author popping in saying
| he'll take a look in February without narrowing it down to
| at least the quarter century said February is supposed to
| be in.
|
| The usual ghost town with tumbleweed on its streets.
| gbacon wrote:
| Perl is a beautiful language. It's fast. It's stable. It's
| expressive. What I really miss working with other languages is
| Perl's documentation.
|
| Bigots gonna bigot. Perl is an unorthodox language; Larry would
| probably prefer eclectic. It's tough being the different kid.
| As paulg wrote, "The superficial demands of orthodoxy make it
| an inexpensive substitute for virtue. And that in turn is one
| of the reasons orthodoxy is so attractive to bad people. You
| could be a horrible person, and yet as long as you're orthodox,
| you're better than everyone who isn't."
| fuzztester wrote:
| >As paulg wrote,
|
| Wow, interesting quote. I agree with it. We see such
| behaviour all the time in people.
|
| Do you remember where you read it? Was it in one of his
| essays or tweets? I would like to read the original, with
| context, if any.
| com wrote:
| It looks like a fairly recent post addressing some
| uncomfortable cultural and political trends:
| https://www.paulgraham.com/heresy.html
| forinti wrote:
| I get that a lot. But he who laughs last...
|
| Whenever the Java troupe gets all excited about multi-line
| strings, or closures, or string interpolation (what nasty
| syntax!), it's my turn to laugh.
|
| All in good spirits, of course.
| anthk wrote:
| Perl5 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 wrote:
| perl 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 wrote:
| Surprisingly (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 wrote:
| > 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 wrote:
| My 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.
| chromatic wrote:
| Your understanding is mostly accurate.
|
| Perl 6 was intended from the start to be the next major
| release of Perl (at various times, a replacement for a 5.10
| or 5.12 or 5.14), and it was intended to have a backwards
| compatibility mode to run 5.8 (or 5.10 or 5.12) code in the
| same process, with full interoperability.
|
| As time went by, that plan became less and less likely.
| Some people came up with the idea that Perl and P6 were
| "sister languages", both to have new major releases. I
| think this happened sometime around 2009 or so, maybe as
| early as 2007.
|
| Also by 2011 or so, the P6 developers effectively scuttled
| the backwards compatibility plan and code written to that
| point, but I've argued that their plan to replace Parrot
| was a mistake enough here and elsewhere already. (Sometimes
| I wonder, now that MoarVM is older than Parrot was when
| Parrot was declared unsuitable, if they've achieved their
| promised speed and compatibility goals.)
| dontupvoteme wrote:
| Indeed, Linguistics is a sincerely underappreciated field.
|
| It's telling that perl is/was absolutely functional at it's
| core -- a pidgin of bash and <proper programming>, if one might
| will.
| librasteve wrote:
| yeah, raku takes the perl functional heritage and adds a bit
| my $logger = -> $m { say $m; $m }; my $add-five = -> $x
| { $x + 5 }; my $add-five-and-log = $add-five o $logger;
| say $add-five-and-log(25); # Prints 25, then prints 30
|
| https://dev.to/rawleyfowler/functional-programming-with-
| raku...
| tetha wrote:
| > 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.
|
| And this becomes a problem in teams.
|
| I do somewhat miss perl, because perl and some libraries did
| some things better than later languages. You could express some
| ideas very concisely. Or, croak and carp only reporting
| functions crossing module or library boundaries in a stack
| trace (instead of some java teams complaining that the log
| aggregation refuses to collect 50kb+ sized stacktraces, not
| even exaggerating there).
|
| Alternatives like python force you into a more maintainable
| style. Like, don't get me wrong, you can write unmaintainable
| code in any language, and python would be my language of choice
| to make a horrible non-understandable mess with the extensive
| meta programming capabilities.
|
| But with perl, you kinda have to put in effort to stay on the
| simple path. If you leave that part, it quickly becomes very
| dark. And I know some of my co-workers.
| Enk1du wrote:
| For me, it's code review that makes me write in a
| maintainable style. It's the team that's responsible for a
| code base and objections are raised whenever anyone thinks
| that they'll struggle to understand this or that line. We
| also enforce consistency. Yes, you _can_ choose any character
| for quoting lists, but for the love of Pete, you _will_
| follow how it's done in every other case (in that file, at
| least).
|
| I'll miss you qw//, but I was out-voted. :(
| sonofhans wrote:
| qw// was always my favorite, too -- distinctive, and quick
| to type.
| librasteve wrote:
| qw/one two three/;
|
| in raku is <one two three>
| ReleaseCandidat wrote:
| > perl has the distinction of being designed by a linguist
|
| ... who won the IOCC 2 times!
| https://www.ioccc.org/winners.html#W
| librasteve wrote:
| in 1986 and 1987 ... yikes
|
| https://www.linkedin.com/pulse/18th-december-day-perl-
| progra...
|
| _Obfuscation coding contests, Perl golf tournaments to
| create the shortest feasible code for a specified function,
| and Perl-language poetry collections have all grown up as a
| result of Perl 's versatility._
|
| Your takeaway may well be that perl is not the kind of thing
| that your boss would like. My takeaway is that perl (and
| raku) is versatile and engenders a sense of -Ofun.
| bloopernova wrote:
| I really like Raku, but haven't yet tried to integrate it into
| anything I do. I was looking at fizzbuzz implementations on
| https://web.archive.org/web/20240116132452/https://rosettaco...
| (as you do), and liked the simplicity of a Raku solution:
| for 1 .. 100 { when $_ %% (3 & 5) { say 'FizzBuzz'; }
| when $_ %% 3 { say 'Fizz'; } when $_ %% 5 {
| say 'Buzz'; } default { .say; } }
| csdvrx wrote:
| I 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 wrote:
| Bummer 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 wrote:
| > 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 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 wrote:
| I dig it, or at least the fact that you stuck it out. Well
| done. :)
|
| Huh, wonder if people who aren't familiar with the subject
| saw "GPT" and thought you were going off into AI gibberish
| land?
| csdvrx wrote:
| > Huh, wonder if people who aren't familiar with the
| subject saw "GPT" and thought you were going off into AI
| gibberish land?
|
| If they don't know GPT is a type of partition table, I
| think their stereotypical dislike of perl is the least of
| their problems!
| nwatson wrote:
| Hmmm, 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 wrote:
| I 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 wrote:
| I 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 wrote:
| If Perl6 hadn't killed Perl, would we still see it in use today?
| demondemidi wrote:
| It didn't and we do.
| anthk wrote:
| Perl5 it's used in OpenBSD base, and it has pledge and unveil
| support.
| tasty_freeze wrote:
| Over 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/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 wrote:
| Perl 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 wrote:
| Perl'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 wrote:
| > 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 wrote:
| Perl was my first love. And I still have warm feelings towards
| it, just like one does with one's first love.
___________________________________________________________________
(page generated 2024-02-03 23:02 UTC)