Skip to main content


#TodayIAchieved a faster implementation of named parameters to extended subroutines via my `Sublike::Extended` #perl module.

Not yet on CPAN until I've given it some more thorough testing to satisfy myself that it's stable and robust, but already it's showing good signs. Subs written using this are now over 30% faster than the equivalent plain perl approach using a slurpy hash.

The speed benefit on top of the existing "it's much shorter and neater to read" that it already had.

Corwin Brust reshared this.

in reply to Paul Evans

I really should start using this at work. I know we don't check our named parameters that closely.

Thanks for all your work, eh! 😃

in reply to nigelsezyarr

@nigelsezyarr It's on CPAN at
https://metacpan.org/pod/Sublike::Extended

Hopefully in a few days I'll have the new faster version up too

in reply to nigelsezyarr

@nigelsezyarr And yeah; most of the point of providing this syntax is to ensure such checking is done, as that sort of thing is often overlooked. Especially with things like optional args, if you don't check for unrecognised ones then typos can easily creep in and cause bugs.
in reply to Paul Evans

I really liked using Kavorka; I know it was slow but that wasn’t critical for my task. Was always sorry the ideas weren’t picked up when sub signatures were put into core.
in reply to Aaron Priven

@aaronpriven Right; Kavorka was one of the inspirations, along with a few other CPAN modules, for the named parameter design. It's being looked at in this upcoming PPC:
https://github.com/Perl/PPCs/pull/54

I've been experimenting with the design in `Sublike::Extended` but hopefully soon I'll start moving it into core proper.