##
# Perl 5
sub foo {
my $a = shift;
...;
}
####
sub foo {
my ($a, $b, $c, $d) = @_;
...;
}
####
sub foo {
my %args = @_;
my ($a, $b, $c, $d) = @args{qw( a b c d )};
# Or:
my ($a, $b, $c, $d) = @{{@_}}{qw( a b c d )};
...;
}