Perl Subroutine Signatures Opinion Blog

This site is an opinion blog about Perl Subroutine Signatures. Subroutine Signatures is plan to added to Perl in the near future. I have a very strong concern in the future of Perl, so I created an independent site about sub signatures. My name is Yuki Kimoto. I'm Perl Light User. I have no media power, community power, political power, and big company power. I just feel and talk about the heart of a weak perl user without a voice.

Why we want subroutine signatures?

As a first starting point, why do we want a subroutine signature?

What is missing in Perl?

JavaScript Function Definition

At first, see JavaScript code. foo function definition.

function foo (args1, args2) {
  
}

Ruby Function Definition

Next, see Ruby code of foo function definition.

def foo (args1, args2)
  
end

Python Function Definition

Next, see Python code of foo function definition.

def foo (args1, args2)
  

PHP Function Definition

Next, see PHP code of foo function definition.

function foo ($args1, $args2) {

}

Perl Function Definition

Last, see Perl code of foo function definition.

sub foo {
  my ($args1, $args2) = @_;
}

Why Perl don't write the other languages?

Argument definition is very generally expression

Argument definition is very generally expression in other all of modern programming languages.

People say

"What is @_?"

"Perl have many symbols."

"Perl is a old and dirty language"

We need subroutine signatures to make Perl argument definitions fit into a very general expression.

This is most biggest reason.

Subroutine signatures remove one of the criticisms "Perl is unreadable".