3 ms·
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'; s
by ecef9-8c0f-4374 4y 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"
- bmn__ 4y agoThis already was available more than ten years ago, you simply had to install a module.
- ecef9-8c0f-4374 4y agoI 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
- matthewpersico 4y agoAnd I believe that with the next release, a simple use v5.36; will enable the feature.