The upcoming subroutine signatures in Perl aren't needed so that Perl can be "cool" (we're long past that). They're needed to make your code more correct.
I have a client that I sometimes write code for and they have the layers of their application nicely defined. Their front-end code makes AJAX calls back to an API written in Perl. That, in turn, calls their backend code, also written in Perl. Much of their API code resembles this:
sub get_something {
my $self = shift;
my ( $id, $foo, $bar ) = validated_list(
\@_,
id => { isa => 'Int' },
foo => { isa => 'Int|Undef' },
bar => { isa => 'Str|Undef' },
);
...
}
I'd much prefer to write:
method get_something(Int $id, Int|Undef $foo, Str|Undef $bar ) {
....
}
But I generally can't, so I settle for what I can get.
This client's backend code often relies on their API code calling them with the correct parameters. What they've done is adopt a strategy of putting their validation/sanitation in their API. What happens if they miss some validation in their API? Fortunately, they have decent tests, but in reality, many developers test against the data they expect to receive, not the unexpected data.
So why don't they have tighter validation on their backend? Much of that relies on database calls using bind parameters and not interpolated SQL, so it seems relatively safe compared to most systems, but they don't too as much validation on the backend because it's so time-consuming to write and it can impact performance. They're relying on their clean API to handle this for them.
This is one area in which Perl is very embarrassing.