Today I saw Damian Conway giving a talk at YAPC::NA 2016 (also known as The Perl Conference now :-). He was talking about some cool Perl 6 features, and I realized that some of them are available right now in Perl 5.

Parameter lists / "signatures" Instead of manually unpacking @_ , you can just write sub foo($bar, $baz) { ... } to define a function with two arguments. This feature is available in core perl5 since version 20 (the syntax changed slightly and it produces better error messages since version 22). It's still experimental in version 24 (and produces corresponding warnings when enabled). However, the CPAN module Function::Parameters adds full support for parameter lists to every perl since 5.14 (albeit with a new keyword ( fun and method ) instead of sub ). It's available right now and not experimental: use Function::Parameters qw(:strict); fun foo($bar, $baz) { ... }

Keyword arguments / named parameters By defining your subroutine as sub foo(:$state, :$head, :$halt) {} , you can call it as foo( head => 0, state => 'A', halt => 'Z', ); or foo( halt => 'Z', state => 'A', head => 0, ); or any argument order you like. You no longer have to remember the position of each argument, which is great, especially if your function takes more than 3 arguments (or you haven't touched the code in a month or three). This is also available in Function::Parameters from perl 5.14 onwards: use Function::Parameters qw(:strict); fun foo(:$state, :$head, :$halt) { }

Interpolating blocks in strings Perl 5 lets you interpolate variables in double-quoted strings, which can be very convenient: say "$greeting, visitor! Would you like some $beverage?"; However, this is limited to variables (scalars and arrays/array slices). There's no way to directly interpolate, say, method or function calls. That's why Perl 6 lets you interpolate arbitrary code in strings by using { blocks } : say "2 + 2 = {2 + 2}"; # "2 + 2 = 4" This feature is available in Quote::Code on CPAN for all perls since 5.14: use Quote::Code; say qc"2 + 2 = {2 + 2}";