News for hackers. Stuff that matters.
Re:Perl 5.38 Released by doctor_eval on Monday July 03, 2023 @05:32AM (#36570691)
IIRC, early Perl was missing little things like named function arguments. So a lot of perl code was really inscrutable. I think “scrutability” is a huge driver of adoption… it’s why HTML and JavaScript became popular - and I reckon it’s why Perl burned out. It’s certainly the reason I never adopted it.

Well, that and CPAN…

Re:Perl 5.38 Released by housecarpenter on Monday July 03, 2023 @11:13AM (#36574055)
> early Perl was missing little things like named function arguments

It's still missing those :)

(To be clear for people unfamiliar with Perl, it probably will never have them, because it doesn't need them. In Perl, all functions effectively have a single parameter of array type. The standard convention is to assign each array entry to a variable at the start of your function definition, and the names of those variables then effectively act as parameter names. But that's just a convention and you can do something else if you want.)

Re:Perl 5.38 Released by cygx on Monday July 03, 2023 @11:40AM (#36574494)
Nowadays, sub signatures can be enabled via

    use feature 'signatures'
which is implied by

    use v5.36
Re:Perl 5.38 Released by elcaro on Wednesday July 05, 2023 @07:50PM (#36608918)
I know cygx already replied, but to be clear, function signatures have been available in Perl since 2015. They were added (as experimental) in 5.20, and are now enabled by default with `use v5.36` or later.

All new features must now go through an experimental phase after the smartmatch debacle. Signatures stayed in experimental status a little longer than most new features due to an unfortunate change with respect the order of function signatures and function prototypes. Provided you weren't using prototypes (which you almost never need) then they've been largely stable since 2015.

Most distro's under current support ship with at least Perl 5.24, so you can use them almost anywhere.

Re:Perl 5.38 Released by cutler on Monday July 03, 2023 @06:49PM (#36579819)
"Unrolling @_" is still a Perl ritual.
Re:Perl 5.38 Released by wlonkly on Tuesday July 04, 2023 @10:51AM (#36587515)
<ok, let's see..>

@_

@_____

@________

<wow, this thing is long>

_____________

<success!>

Re:Perl 5.38 Released by knightcrusader on Monday July 03, 2023 @08:41PM (#36580707)
I wouldn't say its "missing" named function arguments. Treating arguments and return values as lists is very powerful. Perl is very Lisp-like in that aspect.

Also, CPAN is considered one of Perl's strengths. How did CPAN cause Perl to burn out?

Re:Perl 5.38 Released by doctor_eval on Monday July 03, 2023 @11:59PM (#36582067)
In terms of arguments, there's no reason that Perl couldn't have had named arguments and still passed lists around behind the scenes. But the lack of arguments really makes it hard to understand what those arguments are supposed to be. The question is why Perl didn't continue to dominate the scripting landscape and I simply offer this as one possibility.

My recollection of CPAN - and we are talking a really long time ago now - but it was just very much the same kind of dependency hell that we now have with NPM. In fact now that I mention it, I think there are strong comparisons to be made between Node and Perl. CPAN was great until it wasn't, and after a while - in my experience - it was mostly not great.