Hacker News new | ask | show | jobs
by ecef9-8c0f-4374 1514 days ago
Well it's your lucky day. Named parameters are perl since 5.20 ... as an "experimental" feature ...

Now you can write.

use v5.20; use feature 'signatures';

sub print_text( $param1 , $language = "perl", $years = 10 ) { say "I would have loved this $language $param1 more then $years years ago"; }

print_text "feature"

2 comments

And I believe that with the next release, a simple

    use v5.36;
will enable the feature.
This already was available more than ten years ago, you simply had to install a module.
I used to use perl5i for scripting, which had func().

Point is. As soon as I tell someone "you have to use tarball/cpan/cpanplus/cpanminus to install the feature "named parameters" they leave.

But now it's here