Perl 5.20 has experimental support for function signatures. That’s good news. I just thought to check if signatures can be used in subroutine references. They can.
# Set a base set of features.use 5.20.0;
# Signatures are experimental, so are not enabled by default.use feature 'signatures';
# Otherwise Perl will warn about using the experimental featureno warnings 'experimental::signatures';
sub hello($person) { say "Hello, $person";}
my $goodbye = sub($person) { say "Goodbye, $person";};
my $me = "Brian";
hello( $me );$goodbye->( $me );
It’s a simple test. Just checking to see if I can maybe use this feature in my own projects.
$ perl sig-test.plHello, BrianGoodbye, Brian
This pleases me. It’s not going to make life easier for Pygments, though.