Search⌘ K

Function Signatures

Explore how to enable and use Perl's experimental function signatures introduced in version 5.20. Understand setting default values for optional parameters, aggregate arguments, and enforcing no-argument functions. This lesson helps you write clearer and more maintainable Perl subroutines while considering future language changes and alternative CPAN modules.

Perl 5.20 added built-in function signatures as an experimental feature. Experimental means that they may change or even go away in future releases of Perl, so we need to enable them to signal that we accept the possibility of rewriting code:

use experimental 'signatures';

With that disclaimer in ...